diff --git a/.github/workflows/e2e-master.yaml b/.github/workflows/e2e-master.yaml index 89f0bec960..5819a0d796 100644 --- a/.github/workflows/e2e-master.yaml +++ b/.github/workflows/e2e-master.yaml @@ -38,7 +38,9 @@ jobs: python -m pip install --upgrade pip python -m pip install -r requirements.txt python -m pip install -r test-requirements.txt + python -m pip install -r requirements-asyncio.txt + python -m pip install -r test-requirements-asyncio.txt - name: Install package run: python -m pip install -e . - name: Run End to End tests - run: pytest -vvv -s kubernetes/e2e_test + run: pytest -vvv -s kubernetes/e2e_test -s kubernetes_asyncio/e2e_test diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4075a03e07..3af2c58df3 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,6 +24,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt + pip install -r requirements-asyncio.txt - name: Lint with flake8 run: | pip install flake8 diff --git a/examples_asyncio/in_cluster_config.py b/examples_asyncio/in_cluster_config.py new file mode 100644 index 0000000000..5036032368 --- /dev/null +++ b/examples_asyncio/in_cluster_config.py @@ -0,0 +1,86 @@ +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Simple example to show loading config from the cluster + +# +# If you get 403 errors from API server you will have to configure +# RBAC to add necessay permissions. +# +# --- +# kind: ClusterRole +# apiVersion: rbac.authorization.k8s.io/v1 +# metadata: +# name: pods-list +# rules: +# - apiGroups: [""] +# resources: ["pods"] +# verbs: ["list"] +# --- +# kind: ClusterRoleBinding +# apiVersion: rbac.authorization.k8s.io/v1 +# metadata: +# name: pods-list +# subjects: +# - kind: ServiceAccount +# name: default +# namespace: default +# roleRef: +# kind: ClusterRole +# name: pods-list +# apiGroup: rbac.authorization.k8s.io +# --- +# +# Doc: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ +# +# This example can be run from the image: https://hub.docker.com/r/tpimages/kubernetes_asyncio_examples/ +# +# $ kubectl run kubernetes-asyncio-examples --image tpimages/kubernetes_asyncio_examples +# + +import asyncio +import sys +import traceback + +from kubernetes_asyncio import client, config + + +async def main(): + + while True: + + try: + + # it works only if this script is run by K8s as a POD + config.load_incluster_config() + + v1 = client.CoreV1Api() + print("Listing pods with their IPs:") + ret = await v1.list_pod_for_all_namespaces() + + for i in ret.items: + print(i.status.pod_ip, i.metadata.namespace, i.metadata.name) + + except Exception: + traceback.print_exc(file=sys.stdout) + + finally: + print("sleep 10s") + await asyncio.sleep(10) + + +if __name__ == "__main__": + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) + loop.close() diff --git a/examples_asyncio/list_pods.py b/examples_asyncio/list_pods.py new file mode 100644 index 0000000000..ccb0c607a6 --- /dev/null +++ b/examples_asyncio/list_pods.py @@ -0,0 +1,27 @@ +import asyncio + +from kubernetes_asyncio import client, config +from kubernetes_asyncio.client.api_client import ApiClient + + +async def main(): + # Configs can be set in Configuration class directly or using helper + # utility. If no argument provided, the config will be loaded from + # default location. + await config.load_kube_config() + + # use the context manager to close http sessions automatically + async with ApiClient() as api: + + v1 = client.CoreV1Api(api) + print("Listing pods with their IPs:") + ret = await v1.list_pod_for_all_namespaces() + + for i in ret.items: + print(i.status.pod_ip, i.metadata.namespace, i.metadata.name) + + +if __name__ == "__main__": + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) + loop.close() diff --git a/examples_asyncio/patch.py b/examples_asyncio/patch.py new file mode 100644 index 0000000000..ba28e231ab --- /dev/null +++ b/examples_asyncio/patch.py @@ -0,0 +1,109 @@ +import asyncio + +from kubernetes_asyncio import client, config +from kubernetes_asyncio.client.api_client import ApiClient + +SERVICE_NAME = "example-service" +SERVICE_NS = "default" +SERVICE_SPEC = { + "apiVersion": "v1", + "kind": "Service", + "metadata": { + "labels": {"name": SERVICE_NAME}, + "name": SERVICE_NAME, + "resourceversion": "v1", + }, + "spec": { + "ports": [{"name": "port-80", "port": 80, "protocol": "TCP", "targetPort": 80}], + "selector": {"name": SERVICE_NAME}, + }, +} + + +async def main(): + + await config.load_kube_config() + + async with ApiClient() as api: + + v1 = client.CoreV1Api(api) + + print(f"Recreate {SERVICE_NAME}...") + try: + await v1.read_namespaced_service(SERVICE_NAME, SERVICE_NS) + await v1.delete_namespaced_service(SERVICE_NAME, SERVICE_NS) + except client.exceptions.ApiException as ex: + if ex.status == 404: + pass + + await v1.create_namespaced_service(SERVICE_NS, SERVICE_SPEC) + + print("Patch using JSON patch - replace port-80 with port-1000") + patch = [ + { + "op": "replace", + "path": "/spec/ports/0", + "value": { + "name": "port-1000", + "protocol": "TCP", + "port": 1000, + "targetPort": 1000, + }, + } + ] + await v1.patch_namespaced_service( + SERVICE_NAME, + SERVICE_NS, + patch, + # _content_type='application/json-patch+json' # (optional, default if patch is a list) + ) + + print( + "Patch using strategic merge patch - add port-2000, service will have two ports: port-1000 and port-2000" + ) + patch = { + "spec": { + "ports": [ + { + "name": "port-2000", + "protocol": "TCP", + "port": 2000, + "targetPort": 2000, + } + ] + } + } + await v1.patch_namespaced_service( + SERVICE_NAME, + SERVICE_NS, + patch, + # _content_type='application/strategic-merge-patch+json' # (optional, default if patch is a dict) + ) + + print( + "Patch using merge patch - recreate list of ports, service will have only one port: port-3000" + ) + patch = { + "spec": { + "ports": [ + { + "name": "port-3000", + "protocol": "TCP", + "port": 3000, + "targetPort": 3000, + } + ] + } + } + await v1.patch_namespaced_service( + SERVICE_NAME, + SERVICE_NS, + patch, + _content_type="application/merge-patch+json", # required to force merge patch + ) + + +if __name__ == "__main__": + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) + loop.close() diff --git a/kubernetes_asyncio/.gitignore b/kubernetes_asyncio/.gitignore new file mode 100644 index 0000000000..43995bd42f --- /dev/null +++ b/kubernetes_asyncio/.gitignore @@ -0,0 +1,66 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.venv/ +.python-version +.pytest_cache + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/kubernetes_asyncio/.gitlab-ci.yml b/kubernetes_asyncio/.gitlab-ci.yml new file mode 100644 index 0000000000..3c5125d395 --- /dev/null +++ b/kubernetes_asyncio/.gitlab-ci.yml @@ -0,0 +1,33 @@ +# ref: https://docs.gitlab.com/ee/ci/README.html + +stages: + - test + +.nosetest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=client + +nosetest-2.7: + extends: .nosetest + image: python:2.7-alpine +nosetest-3.3: + extends: .nosetest + image: python:3.3-alpine +nosetest-3.4: + extends: .nosetest + image: python:3.4-alpine +nosetest-3.5: + extends: .nosetest + image: python:3.5-alpine +nosetest-3.6: + extends: .nosetest + image: python:3.6-alpine +nosetest-3.7: + extends: .nosetest + image: python:3.7-alpine +nosetest-3.8: + extends: .nosetest + image: python:3.8-alpine diff --git a/kubernetes_asyncio/.openapi-generator-ignore b/kubernetes_asyncio/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/kubernetes_asyncio/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/kubernetes_asyncio/.openapi-generator/COMMIT b/kubernetes_asyncio/.openapi-generator/COMMIT new file mode 100644 index 0000000000..e55d78f521 --- /dev/null +++ b/kubernetes_asyncio/.openapi-generator/COMMIT @@ -0,0 +1,2 @@ +Requested Commit/Tag : v6.6.0 +Actual Commit : 7f8b853f502d9039c9a0aac2614ce92871e895ed diff --git a/kubernetes_asyncio/.openapi-generator/FILES b/kubernetes_asyncio/.openapi-generator/FILES new file mode 100644 index 0000000000..774595a2d3 --- /dev/null +++ b/kubernetes_asyncio/.openapi-generator/FILES @@ -0,0 +1,2407 @@ +.gitignore +.gitlab-ci.yml +.openapi-generator-ignore +.travis.yml +README.md +client/__init__.py +client/api/__init__.py +client/api/admissionregistration_api.py +client/api/admissionregistration_v1_api.py +client/api/admissionregistration_v1alpha1_api.py +client/api/admissionregistration_v1beta1_api.py +client/api/apiextensions_api.py +client/api/apiextensions_v1_api.py +client/api/apiregistration_api.py +client/api/apiregistration_v1_api.py +client/api/apis_api.py +client/api/apps_api.py +client/api/apps_v1_api.py +client/api/authentication_api.py +client/api/authentication_v1_api.py +client/api/authorization_api.py +client/api/authorization_v1_api.py +client/api/autoscaling_api.py +client/api/autoscaling_v1_api.py +client/api/autoscaling_v2_api.py +client/api/batch_api.py +client/api/batch_v1_api.py +client/api/certificates_api.py +client/api/certificates_v1_api.py +client/api/certificates_v1alpha1_api.py +client/api/certificates_v1beta1_api.py +client/api/coordination_api.py +client/api/coordination_v1_api.py +client/api/coordination_v1alpha2_api.py +client/api/coordination_v1beta1_api.py +client/api/core_api.py +client/api/core_v1_api.py +client/api/custom_objects_api.py +client/api/discovery_api.py +client/api/discovery_v1_api.py +client/api/events_api.py +client/api/events_v1_api.py +client/api/flowcontrol_apiserver_api.py +client/api/flowcontrol_apiserver_v1_api.py +client/api/internal_apiserver_api.py +client/api/internal_apiserver_v1alpha1_api.py +client/api/logs_api.py +client/api/networking_api.py +client/api/networking_v1_api.py +client/api/networking_v1beta1_api.py +client/api/node_api.py +client/api/node_v1_api.py +client/api/openid_api.py +client/api/policy_api.py +client/api/policy_v1_api.py +client/api/rbac_authorization_api.py +client/api/rbac_authorization_v1_api.py +client/api/resource_api.py +client/api/resource_v1_api.py +client/api/resource_v1alpha3_api.py +client/api/resource_v1beta1_api.py +client/api/resource_v1beta2_api.py +client/api/scheduling_api.py +client/api/scheduling_v1_api.py +client/api/scheduling_v1alpha1_api.py +client/api/storage_api.py +client/api/storage_v1_api.py +client/api/storage_v1beta1_api.py +client/api/storagemigration_api.py +client/api/storagemigration_v1beta1_api.py +client/api/version_api.py +client/api/well_known_api.py +client/api_client.py +client/configuration.py +client/exceptions.py +client/models/__init__.py +client/models/admissionregistration_v1_service_reference.py +client/models/admissionregistration_v1_webhook_client_config.py +client/models/apiextensions_v1_service_reference.py +client/models/apiextensions_v1_webhook_client_config.py +client/models/apiregistration_v1_service_reference.py +client/models/authentication_v1_token_request.py +client/models/core_v1_endpoint_port.py +client/models/core_v1_event.py +client/models/core_v1_event_list.py +client/models/core_v1_event_series.py +client/models/core_v1_resource_claim.py +client/models/discovery_v1_endpoint_port.py +client/models/events_v1_event.py +client/models/events_v1_event_list.py +client/models/events_v1_event_series.py +client/models/flowcontrol_v1_subject.py +client/models/rbac_v1_subject.py +client/models/resource_v1_resource_claim.py +client/models/storage_v1_token_request.py +client/models/v1_affinity.py +client/models/v1_aggregation_rule.py +client/models/v1_allocated_device_status.py +client/models/v1_allocation_result.py +client/models/v1_api_group.py +client/models/v1_api_group_list.py +client/models/v1_api_resource.py +client/models/v1_api_resource_list.py +client/models/v1_api_service.py +client/models/v1_api_service_condition.py +client/models/v1_api_service_list.py +client/models/v1_api_service_spec.py +client/models/v1_api_service_status.py +client/models/v1_api_versions.py +client/models/v1_app_armor_profile.py +client/models/v1_attached_volume.py +client/models/v1_audit_annotation.py +client/models/v1_aws_elastic_block_store_volume_source.py +client/models/v1_azure_disk_volume_source.py +client/models/v1_azure_file_persistent_volume_source.py +client/models/v1_azure_file_volume_source.py +client/models/v1_binding.py +client/models/v1_bound_object_reference.py +client/models/v1_capabilities.py +client/models/v1_capacity_request_policy.py +client/models/v1_capacity_request_policy_range.py +client/models/v1_capacity_requirements.py +client/models/v1_cel_device_selector.py +client/models/v1_ceph_fs_persistent_volume_source.py +client/models/v1_ceph_fs_volume_source.py +client/models/v1_certificate_signing_request.py +client/models/v1_certificate_signing_request_condition.py +client/models/v1_certificate_signing_request_list.py +client/models/v1_certificate_signing_request_spec.py +client/models/v1_certificate_signing_request_status.py +client/models/v1_cinder_persistent_volume_source.py +client/models/v1_cinder_volume_source.py +client/models/v1_client_ip_config.py +client/models/v1_cluster_role.py +client/models/v1_cluster_role_binding.py +client/models/v1_cluster_role_binding_list.py +client/models/v1_cluster_role_list.py +client/models/v1_cluster_trust_bundle_projection.py +client/models/v1_component_condition.py +client/models/v1_component_status.py +client/models/v1_component_status_list.py +client/models/v1_condition.py +client/models/v1_config_map.py +client/models/v1_config_map_env_source.py +client/models/v1_config_map_key_selector.py +client/models/v1_config_map_list.py +client/models/v1_config_map_node_config_source.py +client/models/v1_config_map_projection.py +client/models/v1_config_map_volume_source.py +client/models/v1_container.py +client/models/v1_container_extended_resource_request.py +client/models/v1_container_image.py +client/models/v1_container_port.py +client/models/v1_container_resize_policy.py +client/models/v1_container_restart_rule.py +client/models/v1_container_restart_rule_on_exit_codes.py +client/models/v1_container_state.py +client/models/v1_container_state_running.py +client/models/v1_container_state_terminated.py +client/models/v1_container_state_waiting.py +client/models/v1_container_status.py +client/models/v1_container_user.py +client/models/v1_controller_revision.py +client/models/v1_controller_revision_list.py +client/models/v1_counter.py +client/models/v1_counter_set.py +client/models/v1_cron_job.py +client/models/v1_cron_job_list.py +client/models/v1_cron_job_spec.py +client/models/v1_cron_job_status.py +client/models/v1_cross_version_object_reference.py +client/models/v1_csi_driver.py +client/models/v1_csi_driver_list.py +client/models/v1_csi_driver_spec.py +client/models/v1_csi_node.py +client/models/v1_csi_node_driver.py +client/models/v1_csi_node_list.py +client/models/v1_csi_node_spec.py +client/models/v1_csi_persistent_volume_source.py +client/models/v1_csi_storage_capacity.py +client/models/v1_csi_storage_capacity_list.py +client/models/v1_csi_volume_source.py +client/models/v1_custom_resource_column_definition.py +client/models/v1_custom_resource_conversion.py +client/models/v1_custom_resource_definition.py +client/models/v1_custom_resource_definition_condition.py +client/models/v1_custom_resource_definition_list.py +client/models/v1_custom_resource_definition_names.py +client/models/v1_custom_resource_definition_spec.py +client/models/v1_custom_resource_definition_status.py +client/models/v1_custom_resource_definition_version.py +client/models/v1_custom_resource_subresource_scale.py +client/models/v1_custom_resource_subresources.py +client/models/v1_custom_resource_validation.py +client/models/v1_daemon_endpoint.py +client/models/v1_daemon_set.py +client/models/v1_daemon_set_condition.py +client/models/v1_daemon_set_list.py +client/models/v1_daemon_set_spec.py +client/models/v1_daemon_set_status.py +client/models/v1_daemon_set_update_strategy.py +client/models/v1_delete_options.py +client/models/v1_deployment.py +client/models/v1_deployment_condition.py +client/models/v1_deployment_list.py +client/models/v1_deployment_spec.py +client/models/v1_deployment_status.py +client/models/v1_deployment_strategy.py +client/models/v1_device.py +client/models/v1_device_allocation_configuration.py +client/models/v1_device_allocation_result.py +client/models/v1_device_attribute.py +client/models/v1_device_capacity.py +client/models/v1_device_claim.py +client/models/v1_device_claim_configuration.py +client/models/v1_device_class.py +client/models/v1_device_class_configuration.py +client/models/v1_device_class_list.py +client/models/v1_device_class_spec.py +client/models/v1_device_constraint.py +client/models/v1_device_counter_consumption.py +client/models/v1_device_request.py +client/models/v1_device_request_allocation_result.py +client/models/v1_device_selector.py +client/models/v1_device_sub_request.py +client/models/v1_device_taint.py +client/models/v1_device_toleration.py +client/models/v1_downward_api_projection.py +client/models/v1_downward_api_volume_file.py +client/models/v1_downward_api_volume_source.py +client/models/v1_empty_dir_volume_source.py +client/models/v1_endpoint.py +client/models/v1_endpoint_address.py +client/models/v1_endpoint_conditions.py +client/models/v1_endpoint_hints.py +client/models/v1_endpoint_slice.py +client/models/v1_endpoint_slice_list.py +client/models/v1_endpoint_subset.py +client/models/v1_endpoints.py +client/models/v1_endpoints_list.py +client/models/v1_env_from_source.py +client/models/v1_env_var.py +client/models/v1_env_var_source.py +client/models/v1_ephemeral_container.py +client/models/v1_ephemeral_volume_source.py +client/models/v1_event_source.py +client/models/v1_eviction.py +client/models/v1_exact_device_request.py +client/models/v1_exec_action.py +client/models/v1_exempt_priority_level_configuration.py +client/models/v1_expression_warning.py +client/models/v1_external_documentation.py +client/models/v1_fc_volume_source.py +client/models/v1_field_selector_attributes.py +client/models/v1_field_selector_requirement.py +client/models/v1_file_key_selector.py +client/models/v1_flex_persistent_volume_source.py +client/models/v1_flex_volume_source.py +client/models/v1_flocker_volume_source.py +client/models/v1_flow_distinguisher_method.py +client/models/v1_flow_schema.py +client/models/v1_flow_schema_condition.py +client/models/v1_flow_schema_list.py +client/models/v1_flow_schema_spec.py +client/models/v1_flow_schema_status.py +client/models/v1_for_node.py +client/models/v1_for_zone.py +client/models/v1_gce_persistent_disk_volume_source.py +client/models/v1_git_repo_volume_source.py +client/models/v1_glusterfs_persistent_volume_source.py +client/models/v1_glusterfs_volume_source.py +client/models/v1_group_resource.py +client/models/v1_group_subject.py +client/models/v1_group_version_for_discovery.py +client/models/v1_grpc_action.py +client/models/v1_horizontal_pod_autoscaler.py +client/models/v1_horizontal_pod_autoscaler_list.py +client/models/v1_horizontal_pod_autoscaler_spec.py +client/models/v1_horizontal_pod_autoscaler_status.py +client/models/v1_host_alias.py +client/models/v1_host_ip.py +client/models/v1_host_path_volume_source.py +client/models/v1_http_get_action.py +client/models/v1_http_header.py +client/models/v1_http_ingress_path.py +client/models/v1_http_ingress_rule_value.py +client/models/v1_image_volume_source.py +client/models/v1_ingress.py +client/models/v1_ingress_backend.py +client/models/v1_ingress_class.py +client/models/v1_ingress_class_list.py +client/models/v1_ingress_class_parameters_reference.py +client/models/v1_ingress_class_spec.py +client/models/v1_ingress_list.py +client/models/v1_ingress_load_balancer_ingress.py +client/models/v1_ingress_load_balancer_status.py +client/models/v1_ingress_port_status.py +client/models/v1_ingress_rule.py +client/models/v1_ingress_service_backend.py +client/models/v1_ingress_spec.py +client/models/v1_ingress_status.py +client/models/v1_ingress_tls.py +client/models/v1_ip_address.py +client/models/v1_ip_address_list.py +client/models/v1_ip_address_spec.py +client/models/v1_ip_block.py +client/models/v1_iscsi_persistent_volume_source.py +client/models/v1_iscsi_volume_source.py +client/models/v1_job.py +client/models/v1_job_condition.py +client/models/v1_job_list.py +client/models/v1_job_spec.py +client/models/v1_job_status.py +client/models/v1_job_template_spec.py +client/models/v1_json_schema_props.py +client/models/v1_key_to_path.py +client/models/v1_label_selector.py +client/models/v1_label_selector_attributes.py +client/models/v1_label_selector_requirement.py +client/models/v1_lease.py +client/models/v1_lease_list.py +client/models/v1_lease_spec.py +client/models/v1_lifecycle.py +client/models/v1_lifecycle_handler.py +client/models/v1_limit_range.py +client/models/v1_limit_range_item.py +client/models/v1_limit_range_list.py +client/models/v1_limit_range_spec.py +client/models/v1_limit_response.py +client/models/v1_limited_priority_level_configuration.py +client/models/v1_linux_container_user.py +client/models/v1_list_meta.py +client/models/v1_load_balancer_ingress.py +client/models/v1_load_balancer_status.py +client/models/v1_local_object_reference.py +client/models/v1_local_subject_access_review.py +client/models/v1_local_volume_source.py +client/models/v1_managed_fields_entry.py +client/models/v1_match_condition.py +client/models/v1_match_resources.py +client/models/v1_modify_volume_status.py +client/models/v1_mutating_webhook.py +client/models/v1_mutating_webhook_configuration.py +client/models/v1_mutating_webhook_configuration_list.py +client/models/v1_named_rule_with_operations.py +client/models/v1_namespace.py +client/models/v1_namespace_condition.py +client/models/v1_namespace_list.py +client/models/v1_namespace_spec.py +client/models/v1_namespace_status.py +client/models/v1_network_device_data.py +client/models/v1_network_policy.py +client/models/v1_network_policy_egress_rule.py +client/models/v1_network_policy_ingress_rule.py +client/models/v1_network_policy_list.py +client/models/v1_network_policy_peer.py +client/models/v1_network_policy_port.py +client/models/v1_network_policy_spec.py +client/models/v1_nfs_volume_source.py +client/models/v1_node.py +client/models/v1_node_address.py +client/models/v1_node_affinity.py +client/models/v1_node_condition.py +client/models/v1_node_config_source.py +client/models/v1_node_config_status.py +client/models/v1_node_daemon_endpoints.py +client/models/v1_node_features.py +client/models/v1_node_list.py +client/models/v1_node_runtime_handler.py +client/models/v1_node_runtime_handler_features.py +client/models/v1_node_selector.py +client/models/v1_node_selector_requirement.py +client/models/v1_node_selector_term.py +client/models/v1_node_spec.py +client/models/v1_node_status.py +client/models/v1_node_swap_status.py +client/models/v1_node_system_info.py +client/models/v1_non_resource_attributes.py +client/models/v1_non_resource_policy_rule.py +client/models/v1_non_resource_rule.py +client/models/v1_object_field_selector.py +client/models/v1_object_meta.py +client/models/v1_object_reference.py +client/models/v1_opaque_device_configuration.py +client/models/v1_overhead.py +client/models/v1_owner_reference.py +client/models/v1_param_kind.py +client/models/v1_param_ref.py +client/models/v1_parent_reference.py +client/models/v1_persistent_volume.py +client/models/v1_persistent_volume_claim.py +client/models/v1_persistent_volume_claim_condition.py +client/models/v1_persistent_volume_claim_list.py +client/models/v1_persistent_volume_claim_spec.py +client/models/v1_persistent_volume_claim_status.py +client/models/v1_persistent_volume_claim_template.py +client/models/v1_persistent_volume_claim_volume_source.py +client/models/v1_persistent_volume_list.py +client/models/v1_persistent_volume_spec.py +client/models/v1_persistent_volume_status.py +client/models/v1_photon_persistent_disk_volume_source.py +client/models/v1_pod.py +client/models/v1_pod_affinity.py +client/models/v1_pod_affinity_term.py +client/models/v1_pod_anti_affinity.py +client/models/v1_pod_certificate_projection.py +client/models/v1_pod_condition.py +client/models/v1_pod_disruption_budget.py +client/models/v1_pod_disruption_budget_list.py +client/models/v1_pod_disruption_budget_spec.py +client/models/v1_pod_disruption_budget_status.py +client/models/v1_pod_dns_config.py +client/models/v1_pod_dns_config_option.py +client/models/v1_pod_extended_resource_claim_status.py +client/models/v1_pod_failure_policy.py +client/models/v1_pod_failure_policy_on_exit_codes_requirement.py +client/models/v1_pod_failure_policy_on_pod_conditions_pattern.py +client/models/v1_pod_failure_policy_rule.py +client/models/v1_pod_ip.py +client/models/v1_pod_list.py +client/models/v1_pod_os.py +client/models/v1_pod_readiness_gate.py +client/models/v1_pod_resource_claim.py +client/models/v1_pod_resource_claim_status.py +client/models/v1_pod_scheduling_gate.py +client/models/v1_pod_security_context.py +client/models/v1_pod_spec.py +client/models/v1_pod_status.py +client/models/v1_pod_template.py +client/models/v1_pod_template_list.py +client/models/v1_pod_template_spec.py +client/models/v1_policy_rule.py +client/models/v1_policy_rules_with_subjects.py +client/models/v1_port_status.py +client/models/v1_portworx_volume_source.py +client/models/v1_preconditions.py +client/models/v1_preferred_scheduling_term.py +client/models/v1_priority_class.py +client/models/v1_priority_class_list.py +client/models/v1_priority_level_configuration.py +client/models/v1_priority_level_configuration_condition.py +client/models/v1_priority_level_configuration_list.py +client/models/v1_priority_level_configuration_reference.py +client/models/v1_priority_level_configuration_spec.py +client/models/v1_priority_level_configuration_status.py +client/models/v1_probe.py +client/models/v1_projected_volume_source.py +client/models/v1_queuing_configuration.py +client/models/v1_quobyte_volume_source.py +client/models/v1_rbd_persistent_volume_source.py +client/models/v1_rbd_volume_source.py +client/models/v1_replica_set.py +client/models/v1_replica_set_condition.py +client/models/v1_replica_set_list.py +client/models/v1_replica_set_spec.py +client/models/v1_replica_set_status.py +client/models/v1_replication_controller.py +client/models/v1_replication_controller_condition.py +client/models/v1_replication_controller_list.py +client/models/v1_replication_controller_spec.py +client/models/v1_replication_controller_status.py +client/models/v1_resource_attributes.py +client/models/v1_resource_claim_consumer_reference.py +client/models/v1_resource_claim_list.py +client/models/v1_resource_claim_spec.py +client/models/v1_resource_claim_status.py +client/models/v1_resource_claim_template.py +client/models/v1_resource_claim_template_list.py +client/models/v1_resource_claim_template_spec.py +client/models/v1_resource_field_selector.py +client/models/v1_resource_health.py +client/models/v1_resource_policy_rule.py +client/models/v1_resource_pool.py +client/models/v1_resource_quota.py +client/models/v1_resource_quota_list.py +client/models/v1_resource_quota_spec.py +client/models/v1_resource_quota_status.py +client/models/v1_resource_requirements.py +client/models/v1_resource_rule.py +client/models/v1_resource_slice.py +client/models/v1_resource_slice_list.py +client/models/v1_resource_slice_spec.py +client/models/v1_resource_status.py +client/models/v1_role.py +client/models/v1_role_binding.py +client/models/v1_role_binding_list.py +client/models/v1_role_list.py +client/models/v1_role_ref.py +client/models/v1_rolling_update_daemon_set.py +client/models/v1_rolling_update_deployment.py +client/models/v1_rolling_update_stateful_set_strategy.py +client/models/v1_rule_with_operations.py +client/models/v1_runtime_class.py +client/models/v1_runtime_class_list.py +client/models/v1_scale.py +client/models/v1_scale_io_persistent_volume_source.py +client/models/v1_scale_io_volume_source.py +client/models/v1_scale_spec.py +client/models/v1_scale_status.py +client/models/v1_scheduling.py +client/models/v1_scope_selector.py +client/models/v1_scoped_resource_selector_requirement.py +client/models/v1_se_linux_options.py +client/models/v1_seccomp_profile.py +client/models/v1_secret.py +client/models/v1_secret_env_source.py +client/models/v1_secret_key_selector.py +client/models/v1_secret_list.py +client/models/v1_secret_projection.py +client/models/v1_secret_reference.py +client/models/v1_secret_volume_source.py +client/models/v1_security_context.py +client/models/v1_selectable_field.py +client/models/v1_self_subject_access_review.py +client/models/v1_self_subject_access_review_spec.py +client/models/v1_self_subject_review.py +client/models/v1_self_subject_review_status.py +client/models/v1_self_subject_rules_review.py +client/models/v1_self_subject_rules_review_spec.py +client/models/v1_server_address_by_client_cidr.py +client/models/v1_service.py +client/models/v1_service_account.py +client/models/v1_service_account_list.py +client/models/v1_service_account_subject.py +client/models/v1_service_account_token_projection.py +client/models/v1_service_backend_port.py +client/models/v1_service_cidr.py +client/models/v1_service_cidr_list.py +client/models/v1_service_cidr_spec.py +client/models/v1_service_cidr_status.py +client/models/v1_service_list.py +client/models/v1_service_port.py +client/models/v1_service_spec.py +client/models/v1_service_status.py +client/models/v1_session_affinity_config.py +client/models/v1_sleep_action.py +client/models/v1_stateful_set.py +client/models/v1_stateful_set_condition.py +client/models/v1_stateful_set_list.py +client/models/v1_stateful_set_ordinals.py +client/models/v1_stateful_set_persistent_volume_claim_retention_policy.py +client/models/v1_stateful_set_spec.py +client/models/v1_stateful_set_status.py +client/models/v1_stateful_set_update_strategy.py +client/models/v1_status.py +client/models/v1_status_cause.py +client/models/v1_status_details.py +client/models/v1_storage_class.py +client/models/v1_storage_class_list.py +client/models/v1_storage_os_persistent_volume_source.py +client/models/v1_storage_os_volume_source.py +client/models/v1_subject_access_review.py +client/models/v1_subject_access_review_spec.py +client/models/v1_subject_access_review_status.py +client/models/v1_subject_rules_review_status.py +client/models/v1_success_policy.py +client/models/v1_success_policy_rule.py +client/models/v1_sysctl.py +client/models/v1_taint.py +client/models/v1_tcp_socket_action.py +client/models/v1_token_request_spec.py +client/models/v1_token_request_status.py +client/models/v1_token_review.py +client/models/v1_token_review_spec.py +client/models/v1_token_review_status.py +client/models/v1_toleration.py +client/models/v1_topology_selector_label_requirement.py +client/models/v1_topology_selector_term.py +client/models/v1_topology_spread_constraint.py +client/models/v1_type_checking.py +client/models/v1_typed_local_object_reference.py +client/models/v1_typed_object_reference.py +client/models/v1_uncounted_terminated_pods.py +client/models/v1_user_info.py +client/models/v1_user_subject.py +client/models/v1_validating_admission_policy.py +client/models/v1_validating_admission_policy_binding.py +client/models/v1_validating_admission_policy_binding_list.py +client/models/v1_validating_admission_policy_binding_spec.py +client/models/v1_validating_admission_policy_list.py +client/models/v1_validating_admission_policy_spec.py +client/models/v1_validating_admission_policy_status.py +client/models/v1_validating_webhook.py +client/models/v1_validating_webhook_configuration.py +client/models/v1_validating_webhook_configuration_list.py +client/models/v1_validation.py +client/models/v1_validation_rule.py +client/models/v1_variable.py +client/models/v1_volume.py +client/models/v1_volume_attachment.py +client/models/v1_volume_attachment_list.py +client/models/v1_volume_attachment_source.py +client/models/v1_volume_attachment_spec.py +client/models/v1_volume_attachment_status.py +client/models/v1_volume_attributes_class.py +client/models/v1_volume_attributes_class_list.py +client/models/v1_volume_device.py +client/models/v1_volume_error.py +client/models/v1_volume_mount.py +client/models/v1_volume_mount_status.py +client/models/v1_volume_node_affinity.py +client/models/v1_volume_node_resources.py +client/models/v1_volume_projection.py +client/models/v1_volume_resource_requirements.py +client/models/v1_vsphere_virtual_disk_volume_source.py +client/models/v1_watch_event.py +client/models/v1_webhook_conversion.py +client/models/v1_weighted_pod_affinity_term.py +client/models/v1_windows_security_context_options.py +client/models/v1_workload_reference.py +client/models/v1alpha1_apply_configuration.py +client/models/v1alpha1_cluster_trust_bundle.py +client/models/v1alpha1_cluster_trust_bundle_list.py +client/models/v1alpha1_cluster_trust_bundle_spec.py +client/models/v1alpha1_gang_scheduling_policy.py +client/models/v1alpha1_json_patch.py +client/models/v1alpha1_match_condition.py +client/models/v1alpha1_match_resources.py +client/models/v1alpha1_mutating_admission_policy.py +client/models/v1alpha1_mutating_admission_policy_binding.py +client/models/v1alpha1_mutating_admission_policy_binding_list.py +client/models/v1alpha1_mutating_admission_policy_binding_spec.py +client/models/v1alpha1_mutating_admission_policy_list.py +client/models/v1alpha1_mutating_admission_policy_spec.py +client/models/v1alpha1_mutation.py +client/models/v1alpha1_named_rule_with_operations.py +client/models/v1alpha1_param_kind.py +client/models/v1alpha1_param_ref.py +client/models/v1alpha1_pod_group.py +client/models/v1alpha1_pod_group_policy.py +client/models/v1alpha1_server_storage_version.py +client/models/v1alpha1_storage_version.py +client/models/v1alpha1_storage_version_condition.py +client/models/v1alpha1_storage_version_list.py +client/models/v1alpha1_storage_version_status.py +client/models/v1alpha1_typed_local_object_reference.py +client/models/v1alpha1_variable.py +client/models/v1alpha1_workload.py +client/models/v1alpha1_workload_list.py +client/models/v1alpha1_workload_spec.py +client/models/v1alpha2_lease_candidate.py +client/models/v1alpha2_lease_candidate_list.py +client/models/v1alpha2_lease_candidate_spec.py +client/models/v1alpha3_device_taint.py +client/models/v1alpha3_device_taint_rule.py +client/models/v1alpha3_device_taint_rule_list.py +client/models/v1alpha3_device_taint_rule_spec.py +client/models/v1alpha3_device_taint_rule_status.py +client/models/v1alpha3_device_taint_selector.py +client/models/v1beta1_allocated_device_status.py +client/models/v1beta1_allocation_result.py +client/models/v1beta1_apply_configuration.py +client/models/v1beta1_basic_device.py +client/models/v1beta1_capacity_request_policy.py +client/models/v1beta1_capacity_request_policy_range.py +client/models/v1beta1_capacity_requirements.py +client/models/v1beta1_cel_device_selector.py +client/models/v1beta1_cluster_trust_bundle.py +client/models/v1beta1_cluster_trust_bundle_list.py +client/models/v1beta1_cluster_trust_bundle_spec.py +client/models/v1beta1_counter.py +client/models/v1beta1_counter_set.py +client/models/v1beta1_device.py +client/models/v1beta1_device_allocation_configuration.py +client/models/v1beta1_device_allocation_result.py +client/models/v1beta1_device_attribute.py +client/models/v1beta1_device_capacity.py +client/models/v1beta1_device_claim.py +client/models/v1beta1_device_claim_configuration.py +client/models/v1beta1_device_class.py +client/models/v1beta1_device_class_configuration.py +client/models/v1beta1_device_class_list.py +client/models/v1beta1_device_class_spec.py +client/models/v1beta1_device_constraint.py +client/models/v1beta1_device_counter_consumption.py +client/models/v1beta1_device_request.py +client/models/v1beta1_device_request_allocation_result.py +client/models/v1beta1_device_selector.py +client/models/v1beta1_device_sub_request.py +client/models/v1beta1_device_taint.py +client/models/v1beta1_device_toleration.py +client/models/v1beta1_ip_address.py +client/models/v1beta1_ip_address_list.py +client/models/v1beta1_ip_address_spec.py +client/models/v1beta1_json_patch.py +client/models/v1beta1_lease_candidate.py +client/models/v1beta1_lease_candidate_list.py +client/models/v1beta1_lease_candidate_spec.py +client/models/v1beta1_match_condition.py +client/models/v1beta1_match_resources.py +client/models/v1beta1_mutating_admission_policy.py +client/models/v1beta1_mutating_admission_policy_binding.py +client/models/v1beta1_mutating_admission_policy_binding_list.py +client/models/v1beta1_mutating_admission_policy_binding_spec.py +client/models/v1beta1_mutating_admission_policy_list.py +client/models/v1beta1_mutating_admission_policy_spec.py +client/models/v1beta1_mutation.py +client/models/v1beta1_named_rule_with_operations.py +client/models/v1beta1_network_device_data.py +client/models/v1beta1_opaque_device_configuration.py +client/models/v1beta1_param_kind.py +client/models/v1beta1_param_ref.py +client/models/v1beta1_parent_reference.py +client/models/v1beta1_pod_certificate_request.py +client/models/v1beta1_pod_certificate_request_list.py +client/models/v1beta1_pod_certificate_request_spec.py +client/models/v1beta1_pod_certificate_request_status.py +client/models/v1beta1_resource_claim.py +client/models/v1beta1_resource_claim_consumer_reference.py +client/models/v1beta1_resource_claim_list.py +client/models/v1beta1_resource_claim_spec.py +client/models/v1beta1_resource_claim_status.py +client/models/v1beta1_resource_claim_template.py +client/models/v1beta1_resource_claim_template_list.py +client/models/v1beta1_resource_claim_template_spec.py +client/models/v1beta1_resource_pool.py +client/models/v1beta1_resource_slice.py +client/models/v1beta1_resource_slice_list.py +client/models/v1beta1_resource_slice_spec.py +client/models/v1beta1_service_cidr.py +client/models/v1beta1_service_cidr_list.py +client/models/v1beta1_service_cidr_spec.py +client/models/v1beta1_service_cidr_status.py +client/models/v1beta1_storage_version_migration.py +client/models/v1beta1_storage_version_migration_list.py +client/models/v1beta1_storage_version_migration_spec.py +client/models/v1beta1_storage_version_migration_status.py +client/models/v1beta1_variable.py +client/models/v1beta1_volume_attributes_class.py +client/models/v1beta1_volume_attributes_class_list.py +client/models/v1beta2_allocated_device_status.py +client/models/v1beta2_allocation_result.py +client/models/v1beta2_capacity_request_policy.py +client/models/v1beta2_capacity_request_policy_range.py +client/models/v1beta2_capacity_requirements.py +client/models/v1beta2_cel_device_selector.py +client/models/v1beta2_counter.py +client/models/v1beta2_counter_set.py +client/models/v1beta2_device.py +client/models/v1beta2_device_allocation_configuration.py +client/models/v1beta2_device_allocation_result.py +client/models/v1beta2_device_attribute.py +client/models/v1beta2_device_capacity.py +client/models/v1beta2_device_claim.py +client/models/v1beta2_device_claim_configuration.py +client/models/v1beta2_device_class.py +client/models/v1beta2_device_class_configuration.py +client/models/v1beta2_device_class_list.py +client/models/v1beta2_device_class_spec.py +client/models/v1beta2_device_constraint.py +client/models/v1beta2_device_counter_consumption.py +client/models/v1beta2_device_request.py +client/models/v1beta2_device_request_allocation_result.py +client/models/v1beta2_device_selector.py +client/models/v1beta2_device_sub_request.py +client/models/v1beta2_device_taint.py +client/models/v1beta2_device_toleration.py +client/models/v1beta2_exact_device_request.py +client/models/v1beta2_network_device_data.py +client/models/v1beta2_opaque_device_configuration.py +client/models/v1beta2_resource_claim.py +client/models/v1beta2_resource_claim_consumer_reference.py +client/models/v1beta2_resource_claim_list.py +client/models/v1beta2_resource_claim_spec.py +client/models/v1beta2_resource_claim_status.py +client/models/v1beta2_resource_claim_template.py +client/models/v1beta2_resource_claim_template_list.py +client/models/v1beta2_resource_claim_template_spec.py +client/models/v1beta2_resource_pool.py +client/models/v1beta2_resource_slice.py +client/models/v1beta2_resource_slice_list.py +client/models/v1beta2_resource_slice_spec.py +client/models/v2_api_group_discovery.py +client/models/v2_api_group_discovery_list.py +client/models/v2_api_resource_discovery.py +client/models/v2_api_subresource_discovery.py +client/models/v2_api_version_discovery.py +client/models/v2_container_resource_metric_source.py +client/models/v2_container_resource_metric_status.py +client/models/v2_cross_version_object_reference.py +client/models/v2_external_metric_source.py +client/models/v2_external_metric_status.py +client/models/v2_horizontal_pod_autoscaler.py +client/models/v2_horizontal_pod_autoscaler_behavior.py +client/models/v2_horizontal_pod_autoscaler_condition.py +client/models/v2_horizontal_pod_autoscaler_list.py +client/models/v2_horizontal_pod_autoscaler_spec.py +client/models/v2_horizontal_pod_autoscaler_status.py +client/models/v2_hpa_scaling_policy.py +client/models/v2_hpa_scaling_rules.py +client/models/v2_metric_identifier.py +client/models/v2_metric_spec.py +client/models/v2_metric_status.py +client/models/v2_metric_target.py +client/models/v2_metric_value_status.py +client/models/v2_object_metric_source.py +client/models/v2_object_metric_status.py +client/models/v2_pods_metric_source.py +client/models/v2_pods_metric_status.py +client/models/v2_resource_metric_source.py +client/models/v2_resource_metric_status.py +client/models/v2beta1_api_group_discovery.py +client/models/v2beta1_api_group_discovery_list.py +client/models/v2beta1_api_resource_discovery.py +client/models/v2beta1_api_subresource_discovery.py +client/models/v2beta1_api_version_discovery.py +client/models/version_info.py +client/rest.py +docs/AdmissionregistrationApi.md +docs/AdmissionregistrationV1Api.md +docs/AdmissionregistrationV1ServiceReference.md +docs/AdmissionregistrationV1WebhookClientConfig.md +docs/AdmissionregistrationV1alpha1Api.md +docs/AdmissionregistrationV1beta1Api.md +docs/ApiextensionsApi.md +docs/ApiextensionsV1Api.md +docs/ApiextensionsV1ServiceReference.md +docs/ApiextensionsV1WebhookClientConfig.md +docs/ApiregistrationApi.md +docs/ApiregistrationV1Api.md +docs/ApiregistrationV1ServiceReference.md +docs/ApisApi.md +docs/AppsApi.md +docs/AppsV1Api.md +docs/AuthenticationApi.md +docs/AuthenticationV1Api.md +docs/AuthenticationV1TokenRequest.md +docs/AuthorizationApi.md +docs/AuthorizationV1Api.md +docs/AutoscalingApi.md +docs/AutoscalingV1Api.md +docs/AutoscalingV2Api.md +docs/BatchApi.md +docs/BatchV1Api.md +docs/CertificatesApi.md +docs/CertificatesV1Api.md +docs/CertificatesV1alpha1Api.md +docs/CertificatesV1beta1Api.md +docs/CoordinationApi.md +docs/CoordinationV1Api.md +docs/CoordinationV1alpha2Api.md +docs/CoordinationV1beta1Api.md +docs/CoreApi.md +docs/CoreV1Api.md +docs/CoreV1EndpointPort.md +docs/CoreV1Event.md +docs/CoreV1EventList.md +docs/CoreV1EventSeries.md +docs/CoreV1ResourceClaim.md +docs/CustomObjectsApi.md +docs/DiscoveryApi.md +docs/DiscoveryV1Api.md +docs/DiscoveryV1EndpointPort.md +docs/EventsApi.md +docs/EventsV1Api.md +docs/EventsV1Event.md +docs/EventsV1EventList.md +docs/EventsV1EventSeries.md +docs/FlowcontrolApiserverApi.md +docs/FlowcontrolApiserverV1Api.md +docs/FlowcontrolV1Subject.md +docs/InternalApiserverApi.md +docs/InternalApiserverV1alpha1Api.md +docs/LogsApi.md +docs/NetworkingApi.md +docs/NetworkingV1Api.md +docs/NetworkingV1beta1Api.md +docs/NodeApi.md +docs/NodeV1Api.md +docs/OpenidApi.md +docs/PolicyApi.md +docs/PolicyV1Api.md +docs/RbacAuthorizationApi.md +docs/RbacAuthorizationV1Api.md +docs/RbacV1Subject.md +docs/ResourceApi.md +docs/ResourceV1Api.md +docs/ResourceV1ResourceClaim.md +docs/ResourceV1alpha3Api.md +docs/ResourceV1beta1Api.md +docs/ResourceV1beta2Api.md +docs/SchedulingApi.md +docs/SchedulingV1Api.md +docs/SchedulingV1alpha1Api.md +docs/StorageApi.md +docs/StorageV1Api.md +docs/StorageV1TokenRequest.md +docs/StorageV1beta1Api.md +docs/StoragemigrationApi.md +docs/StoragemigrationV1beta1Api.md +docs/V1APIGroup.md +docs/V1APIGroupList.md +docs/V1APIResource.md +docs/V1APIResourceList.md +docs/V1APIService.md +docs/V1APIServiceCondition.md +docs/V1APIServiceList.md +docs/V1APIServiceSpec.md +docs/V1APIServiceStatus.md +docs/V1APIVersions.md +docs/V1AWSElasticBlockStoreVolumeSource.md +docs/V1Affinity.md +docs/V1AggregationRule.md +docs/V1AllocatedDeviceStatus.md +docs/V1AllocationResult.md +docs/V1AppArmorProfile.md +docs/V1AttachedVolume.md +docs/V1AuditAnnotation.md +docs/V1AzureDiskVolumeSource.md +docs/V1AzureFilePersistentVolumeSource.md +docs/V1AzureFileVolumeSource.md +docs/V1Binding.md +docs/V1BoundObjectReference.md +docs/V1CELDeviceSelector.md +docs/V1CSIDriver.md +docs/V1CSIDriverList.md +docs/V1CSIDriverSpec.md +docs/V1CSINode.md +docs/V1CSINodeDriver.md +docs/V1CSINodeList.md +docs/V1CSINodeSpec.md +docs/V1CSIPersistentVolumeSource.md +docs/V1CSIStorageCapacity.md +docs/V1CSIStorageCapacityList.md +docs/V1CSIVolumeSource.md +docs/V1Capabilities.md +docs/V1CapacityRequestPolicy.md +docs/V1CapacityRequestPolicyRange.md +docs/V1CapacityRequirements.md +docs/V1CephFSPersistentVolumeSource.md +docs/V1CephFSVolumeSource.md +docs/V1CertificateSigningRequest.md +docs/V1CertificateSigningRequestCondition.md +docs/V1CertificateSigningRequestList.md +docs/V1CertificateSigningRequestSpec.md +docs/V1CertificateSigningRequestStatus.md +docs/V1CinderPersistentVolumeSource.md +docs/V1CinderVolumeSource.md +docs/V1ClientIPConfig.md +docs/V1ClusterRole.md +docs/V1ClusterRoleBinding.md +docs/V1ClusterRoleBindingList.md +docs/V1ClusterRoleList.md +docs/V1ClusterTrustBundleProjection.md +docs/V1ComponentCondition.md +docs/V1ComponentStatus.md +docs/V1ComponentStatusList.md +docs/V1Condition.md +docs/V1ConfigMap.md +docs/V1ConfigMapEnvSource.md +docs/V1ConfigMapKeySelector.md +docs/V1ConfigMapList.md +docs/V1ConfigMapNodeConfigSource.md +docs/V1ConfigMapProjection.md +docs/V1ConfigMapVolumeSource.md +docs/V1Container.md +docs/V1ContainerExtendedResourceRequest.md +docs/V1ContainerImage.md +docs/V1ContainerPort.md +docs/V1ContainerResizePolicy.md +docs/V1ContainerRestartRule.md +docs/V1ContainerRestartRuleOnExitCodes.md +docs/V1ContainerState.md +docs/V1ContainerStateRunning.md +docs/V1ContainerStateTerminated.md +docs/V1ContainerStateWaiting.md +docs/V1ContainerStatus.md +docs/V1ContainerUser.md +docs/V1ControllerRevision.md +docs/V1ControllerRevisionList.md +docs/V1Counter.md +docs/V1CounterSet.md +docs/V1CronJob.md +docs/V1CronJobList.md +docs/V1CronJobSpec.md +docs/V1CronJobStatus.md +docs/V1CrossVersionObjectReference.md +docs/V1CustomResourceColumnDefinition.md +docs/V1CustomResourceConversion.md +docs/V1CustomResourceDefinition.md +docs/V1CustomResourceDefinitionCondition.md +docs/V1CustomResourceDefinitionList.md +docs/V1CustomResourceDefinitionNames.md +docs/V1CustomResourceDefinitionSpec.md +docs/V1CustomResourceDefinitionStatus.md +docs/V1CustomResourceDefinitionVersion.md +docs/V1CustomResourceSubresourceScale.md +docs/V1CustomResourceSubresources.md +docs/V1CustomResourceValidation.md +docs/V1DaemonEndpoint.md +docs/V1DaemonSet.md +docs/V1DaemonSetCondition.md +docs/V1DaemonSetList.md +docs/V1DaemonSetSpec.md +docs/V1DaemonSetStatus.md +docs/V1DaemonSetUpdateStrategy.md +docs/V1DeleteOptions.md +docs/V1Deployment.md +docs/V1DeploymentCondition.md +docs/V1DeploymentList.md +docs/V1DeploymentSpec.md +docs/V1DeploymentStatus.md +docs/V1DeploymentStrategy.md +docs/V1Device.md +docs/V1DeviceAllocationConfiguration.md +docs/V1DeviceAllocationResult.md +docs/V1DeviceAttribute.md +docs/V1DeviceCapacity.md +docs/V1DeviceClaim.md +docs/V1DeviceClaimConfiguration.md +docs/V1DeviceClass.md +docs/V1DeviceClassConfiguration.md +docs/V1DeviceClassList.md +docs/V1DeviceClassSpec.md +docs/V1DeviceConstraint.md +docs/V1DeviceCounterConsumption.md +docs/V1DeviceRequest.md +docs/V1DeviceRequestAllocationResult.md +docs/V1DeviceSelector.md +docs/V1DeviceSubRequest.md +docs/V1DeviceTaint.md +docs/V1DeviceToleration.md +docs/V1DownwardAPIProjection.md +docs/V1DownwardAPIVolumeFile.md +docs/V1DownwardAPIVolumeSource.md +docs/V1EmptyDirVolumeSource.md +docs/V1Endpoint.md +docs/V1EndpointAddress.md +docs/V1EndpointConditions.md +docs/V1EndpointHints.md +docs/V1EndpointSlice.md +docs/V1EndpointSliceList.md +docs/V1EndpointSubset.md +docs/V1Endpoints.md +docs/V1EndpointsList.md +docs/V1EnvFromSource.md +docs/V1EnvVar.md +docs/V1EnvVarSource.md +docs/V1EphemeralContainer.md +docs/V1EphemeralVolumeSource.md +docs/V1EventSource.md +docs/V1Eviction.md +docs/V1ExactDeviceRequest.md +docs/V1ExecAction.md +docs/V1ExemptPriorityLevelConfiguration.md +docs/V1ExpressionWarning.md +docs/V1ExternalDocumentation.md +docs/V1FCVolumeSource.md +docs/V1FieldSelectorAttributes.md +docs/V1FieldSelectorRequirement.md +docs/V1FileKeySelector.md +docs/V1FlexPersistentVolumeSource.md +docs/V1FlexVolumeSource.md +docs/V1FlockerVolumeSource.md +docs/V1FlowDistinguisherMethod.md +docs/V1FlowSchema.md +docs/V1FlowSchemaCondition.md +docs/V1FlowSchemaList.md +docs/V1FlowSchemaSpec.md +docs/V1FlowSchemaStatus.md +docs/V1ForNode.md +docs/V1ForZone.md +docs/V1GCEPersistentDiskVolumeSource.md +docs/V1GRPCAction.md +docs/V1GitRepoVolumeSource.md +docs/V1GlusterfsPersistentVolumeSource.md +docs/V1GlusterfsVolumeSource.md +docs/V1GroupResource.md +docs/V1GroupSubject.md +docs/V1GroupVersionForDiscovery.md +docs/V1HTTPGetAction.md +docs/V1HTTPHeader.md +docs/V1HTTPIngressPath.md +docs/V1HTTPIngressRuleValue.md +docs/V1HorizontalPodAutoscaler.md +docs/V1HorizontalPodAutoscalerList.md +docs/V1HorizontalPodAutoscalerSpec.md +docs/V1HorizontalPodAutoscalerStatus.md +docs/V1HostAlias.md +docs/V1HostIP.md +docs/V1HostPathVolumeSource.md +docs/V1IPAddress.md +docs/V1IPAddressList.md +docs/V1IPAddressSpec.md +docs/V1IPBlock.md +docs/V1ISCSIPersistentVolumeSource.md +docs/V1ISCSIVolumeSource.md +docs/V1ImageVolumeSource.md +docs/V1Ingress.md +docs/V1IngressBackend.md +docs/V1IngressClass.md +docs/V1IngressClassList.md +docs/V1IngressClassParametersReference.md +docs/V1IngressClassSpec.md +docs/V1IngressList.md +docs/V1IngressLoadBalancerIngress.md +docs/V1IngressLoadBalancerStatus.md +docs/V1IngressPortStatus.md +docs/V1IngressRule.md +docs/V1IngressServiceBackend.md +docs/V1IngressSpec.md +docs/V1IngressStatus.md +docs/V1IngressTLS.md +docs/V1JSONSchemaProps.md +docs/V1Job.md +docs/V1JobCondition.md +docs/V1JobList.md +docs/V1JobSpec.md +docs/V1JobStatus.md +docs/V1JobTemplateSpec.md +docs/V1KeyToPath.md +docs/V1LabelSelector.md +docs/V1LabelSelectorAttributes.md +docs/V1LabelSelectorRequirement.md +docs/V1Lease.md +docs/V1LeaseList.md +docs/V1LeaseSpec.md +docs/V1Lifecycle.md +docs/V1LifecycleHandler.md +docs/V1LimitRange.md +docs/V1LimitRangeItem.md +docs/V1LimitRangeList.md +docs/V1LimitRangeSpec.md +docs/V1LimitResponse.md +docs/V1LimitedPriorityLevelConfiguration.md +docs/V1LinuxContainerUser.md +docs/V1ListMeta.md +docs/V1LoadBalancerIngress.md +docs/V1LoadBalancerStatus.md +docs/V1LocalObjectReference.md +docs/V1LocalSubjectAccessReview.md +docs/V1LocalVolumeSource.md +docs/V1ManagedFieldsEntry.md +docs/V1MatchCondition.md +docs/V1MatchResources.md +docs/V1ModifyVolumeStatus.md +docs/V1MutatingWebhook.md +docs/V1MutatingWebhookConfiguration.md +docs/V1MutatingWebhookConfigurationList.md +docs/V1NFSVolumeSource.md +docs/V1NamedRuleWithOperations.md +docs/V1Namespace.md +docs/V1NamespaceCondition.md +docs/V1NamespaceList.md +docs/V1NamespaceSpec.md +docs/V1NamespaceStatus.md +docs/V1NetworkDeviceData.md +docs/V1NetworkPolicy.md +docs/V1NetworkPolicyEgressRule.md +docs/V1NetworkPolicyIngressRule.md +docs/V1NetworkPolicyList.md +docs/V1NetworkPolicyPeer.md +docs/V1NetworkPolicyPort.md +docs/V1NetworkPolicySpec.md +docs/V1Node.md +docs/V1NodeAddress.md +docs/V1NodeAffinity.md +docs/V1NodeCondition.md +docs/V1NodeConfigSource.md +docs/V1NodeConfigStatus.md +docs/V1NodeDaemonEndpoints.md +docs/V1NodeFeatures.md +docs/V1NodeList.md +docs/V1NodeRuntimeHandler.md +docs/V1NodeRuntimeHandlerFeatures.md +docs/V1NodeSelector.md +docs/V1NodeSelectorRequirement.md +docs/V1NodeSelectorTerm.md +docs/V1NodeSpec.md +docs/V1NodeStatus.md +docs/V1NodeSwapStatus.md +docs/V1NodeSystemInfo.md +docs/V1NonResourceAttributes.md +docs/V1NonResourcePolicyRule.md +docs/V1NonResourceRule.md +docs/V1ObjectFieldSelector.md +docs/V1ObjectMeta.md +docs/V1ObjectReference.md +docs/V1OpaqueDeviceConfiguration.md +docs/V1Overhead.md +docs/V1OwnerReference.md +docs/V1ParamKind.md +docs/V1ParamRef.md +docs/V1ParentReference.md +docs/V1PersistentVolume.md +docs/V1PersistentVolumeClaim.md +docs/V1PersistentVolumeClaimCondition.md +docs/V1PersistentVolumeClaimList.md +docs/V1PersistentVolumeClaimSpec.md +docs/V1PersistentVolumeClaimStatus.md +docs/V1PersistentVolumeClaimTemplate.md +docs/V1PersistentVolumeClaimVolumeSource.md +docs/V1PersistentVolumeList.md +docs/V1PersistentVolumeSpec.md +docs/V1PersistentVolumeStatus.md +docs/V1PhotonPersistentDiskVolumeSource.md +docs/V1Pod.md +docs/V1PodAffinity.md +docs/V1PodAffinityTerm.md +docs/V1PodAntiAffinity.md +docs/V1PodCertificateProjection.md +docs/V1PodCondition.md +docs/V1PodDNSConfig.md +docs/V1PodDNSConfigOption.md +docs/V1PodDisruptionBudget.md +docs/V1PodDisruptionBudgetList.md +docs/V1PodDisruptionBudgetSpec.md +docs/V1PodDisruptionBudgetStatus.md +docs/V1PodExtendedResourceClaimStatus.md +docs/V1PodFailurePolicy.md +docs/V1PodFailurePolicyOnExitCodesRequirement.md +docs/V1PodFailurePolicyOnPodConditionsPattern.md +docs/V1PodFailurePolicyRule.md +docs/V1PodIP.md +docs/V1PodList.md +docs/V1PodOS.md +docs/V1PodReadinessGate.md +docs/V1PodResourceClaim.md +docs/V1PodResourceClaimStatus.md +docs/V1PodSchedulingGate.md +docs/V1PodSecurityContext.md +docs/V1PodSpec.md +docs/V1PodStatus.md +docs/V1PodTemplate.md +docs/V1PodTemplateList.md +docs/V1PodTemplateSpec.md +docs/V1PolicyRule.md +docs/V1PolicyRulesWithSubjects.md +docs/V1PortStatus.md +docs/V1PortworxVolumeSource.md +docs/V1Preconditions.md +docs/V1PreferredSchedulingTerm.md +docs/V1PriorityClass.md +docs/V1PriorityClassList.md +docs/V1PriorityLevelConfiguration.md +docs/V1PriorityLevelConfigurationCondition.md +docs/V1PriorityLevelConfigurationList.md +docs/V1PriorityLevelConfigurationReference.md +docs/V1PriorityLevelConfigurationSpec.md +docs/V1PriorityLevelConfigurationStatus.md +docs/V1Probe.md +docs/V1ProjectedVolumeSource.md +docs/V1QueuingConfiguration.md +docs/V1QuobyteVolumeSource.md +docs/V1RBDPersistentVolumeSource.md +docs/V1RBDVolumeSource.md +docs/V1ReplicaSet.md +docs/V1ReplicaSetCondition.md +docs/V1ReplicaSetList.md +docs/V1ReplicaSetSpec.md +docs/V1ReplicaSetStatus.md +docs/V1ReplicationController.md +docs/V1ReplicationControllerCondition.md +docs/V1ReplicationControllerList.md +docs/V1ReplicationControllerSpec.md +docs/V1ReplicationControllerStatus.md +docs/V1ResourceAttributes.md +docs/V1ResourceClaimConsumerReference.md +docs/V1ResourceClaimList.md +docs/V1ResourceClaimSpec.md +docs/V1ResourceClaimStatus.md +docs/V1ResourceClaimTemplate.md +docs/V1ResourceClaimTemplateList.md +docs/V1ResourceClaimTemplateSpec.md +docs/V1ResourceFieldSelector.md +docs/V1ResourceHealth.md +docs/V1ResourcePolicyRule.md +docs/V1ResourcePool.md +docs/V1ResourceQuota.md +docs/V1ResourceQuotaList.md +docs/V1ResourceQuotaSpec.md +docs/V1ResourceQuotaStatus.md +docs/V1ResourceRequirements.md +docs/V1ResourceRule.md +docs/V1ResourceSlice.md +docs/V1ResourceSliceList.md +docs/V1ResourceSliceSpec.md +docs/V1ResourceStatus.md +docs/V1Role.md +docs/V1RoleBinding.md +docs/V1RoleBindingList.md +docs/V1RoleList.md +docs/V1RoleRef.md +docs/V1RollingUpdateDaemonSet.md +docs/V1RollingUpdateDeployment.md +docs/V1RollingUpdateStatefulSetStrategy.md +docs/V1RuleWithOperations.md +docs/V1RuntimeClass.md +docs/V1RuntimeClassList.md +docs/V1SELinuxOptions.md +docs/V1Scale.md +docs/V1ScaleIOPersistentVolumeSource.md +docs/V1ScaleIOVolumeSource.md +docs/V1ScaleSpec.md +docs/V1ScaleStatus.md +docs/V1Scheduling.md +docs/V1ScopeSelector.md +docs/V1ScopedResourceSelectorRequirement.md +docs/V1SeccompProfile.md +docs/V1Secret.md +docs/V1SecretEnvSource.md +docs/V1SecretKeySelector.md +docs/V1SecretList.md +docs/V1SecretProjection.md +docs/V1SecretReference.md +docs/V1SecretVolumeSource.md +docs/V1SecurityContext.md +docs/V1SelectableField.md +docs/V1SelfSubjectAccessReview.md +docs/V1SelfSubjectAccessReviewSpec.md +docs/V1SelfSubjectReview.md +docs/V1SelfSubjectReviewStatus.md +docs/V1SelfSubjectRulesReview.md +docs/V1SelfSubjectRulesReviewSpec.md +docs/V1ServerAddressByClientCIDR.md +docs/V1Service.md +docs/V1ServiceAccount.md +docs/V1ServiceAccountList.md +docs/V1ServiceAccountSubject.md +docs/V1ServiceAccountTokenProjection.md +docs/V1ServiceBackendPort.md +docs/V1ServiceCIDR.md +docs/V1ServiceCIDRList.md +docs/V1ServiceCIDRSpec.md +docs/V1ServiceCIDRStatus.md +docs/V1ServiceList.md +docs/V1ServicePort.md +docs/V1ServiceSpec.md +docs/V1ServiceStatus.md +docs/V1SessionAffinityConfig.md +docs/V1SleepAction.md +docs/V1StatefulSet.md +docs/V1StatefulSetCondition.md +docs/V1StatefulSetList.md +docs/V1StatefulSetOrdinals.md +docs/V1StatefulSetPersistentVolumeClaimRetentionPolicy.md +docs/V1StatefulSetSpec.md +docs/V1StatefulSetStatus.md +docs/V1StatefulSetUpdateStrategy.md +docs/V1Status.md +docs/V1StatusCause.md +docs/V1StatusDetails.md +docs/V1StorageClass.md +docs/V1StorageClassList.md +docs/V1StorageOSPersistentVolumeSource.md +docs/V1StorageOSVolumeSource.md +docs/V1SubjectAccessReview.md +docs/V1SubjectAccessReviewSpec.md +docs/V1SubjectAccessReviewStatus.md +docs/V1SubjectRulesReviewStatus.md +docs/V1SuccessPolicy.md +docs/V1SuccessPolicyRule.md +docs/V1Sysctl.md +docs/V1TCPSocketAction.md +docs/V1Taint.md +docs/V1TokenRequestSpec.md +docs/V1TokenRequestStatus.md +docs/V1TokenReview.md +docs/V1TokenReviewSpec.md +docs/V1TokenReviewStatus.md +docs/V1Toleration.md +docs/V1TopologySelectorLabelRequirement.md +docs/V1TopologySelectorTerm.md +docs/V1TopologySpreadConstraint.md +docs/V1TypeChecking.md +docs/V1TypedLocalObjectReference.md +docs/V1TypedObjectReference.md +docs/V1UncountedTerminatedPods.md +docs/V1UserInfo.md +docs/V1UserSubject.md +docs/V1ValidatingAdmissionPolicy.md +docs/V1ValidatingAdmissionPolicyBinding.md +docs/V1ValidatingAdmissionPolicyBindingList.md +docs/V1ValidatingAdmissionPolicyBindingSpec.md +docs/V1ValidatingAdmissionPolicyList.md +docs/V1ValidatingAdmissionPolicySpec.md +docs/V1ValidatingAdmissionPolicyStatus.md +docs/V1ValidatingWebhook.md +docs/V1ValidatingWebhookConfiguration.md +docs/V1ValidatingWebhookConfigurationList.md +docs/V1Validation.md +docs/V1ValidationRule.md +docs/V1Variable.md +docs/V1Volume.md +docs/V1VolumeAttachment.md +docs/V1VolumeAttachmentList.md +docs/V1VolumeAttachmentSource.md +docs/V1VolumeAttachmentSpec.md +docs/V1VolumeAttachmentStatus.md +docs/V1VolumeAttributesClass.md +docs/V1VolumeAttributesClassList.md +docs/V1VolumeDevice.md +docs/V1VolumeError.md +docs/V1VolumeMount.md +docs/V1VolumeMountStatus.md +docs/V1VolumeNodeAffinity.md +docs/V1VolumeNodeResources.md +docs/V1VolumeProjection.md +docs/V1VolumeResourceRequirements.md +docs/V1VsphereVirtualDiskVolumeSource.md +docs/V1WatchEvent.md +docs/V1WebhookConversion.md +docs/V1WeightedPodAffinityTerm.md +docs/V1WindowsSecurityContextOptions.md +docs/V1WorkloadReference.md +docs/V1alpha1ApplyConfiguration.md +docs/V1alpha1ClusterTrustBundle.md +docs/V1alpha1ClusterTrustBundleList.md +docs/V1alpha1ClusterTrustBundleSpec.md +docs/V1alpha1GangSchedulingPolicy.md +docs/V1alpha1JSONPatch.md +docs/V1alpha1MatchCondition.md +docs/V1alpha1MatchResources.md +docs/V1alpha1MutatingAdmissionPolicy.md +docs/V1alpha1MutatingAdmissionPolicyBinding.md +docs/V1alpha1MutatingAdmissionPolicyBindingList.md +docs/V1alpha1MutatingAdmissionPolicyBindingSpec.md +docs/V1alpha1MutatingAdmissionPolicyList.md +docs/V1alpha1MutatingAdmissionPolicySpec.md +docs/V1alpha1Mutation.md +docs/V1alpha1NamedRuleWithOperations.md +docs/V1alpha1ParamKind.md +docs/V1alpha1ParamRef.md +docs/V1alpha1PodGroup.md +docs/V1alpha1PodGroupPolicy.md +docs/V1alpha1ServerStorageVersion.md +docs/V1alpha1StorageVersion.md +docs/V1alpha1StorageVersionCondition.md +docs/V1alpha1StorageVersionList.md +docs/V1alpha1StorageVersionStatus.md +docs/V1alpha1TypedLocalObjectReference.md +docs/V1alpha1Variable.md +docs/V1alpha1Workload.md +docs/V1alpha1WorkloadList.md +docs/V1alpha1WorkloadSpec.md +docs/V1alpha2LeaseCandidate.md +docs/V1alpha2LeaseCandidateList.md +docs/V1alpha2LeaseCandidateSpec.md +docs/V1alpha3DeviceTaint.md +docs/V1alpha3DeviceTaintRule.md +docs/V1alpha3DeviceTaintRuleList.md +docs/V1alpha3DeviceTaintRuleSpec.md +docs/V1alpha3DeviceTaintRuleStatus.md +docs/V1alpha3DeviceTaintSelector.md +docs/V1beta1AllocatedDeviceStatus.md +docs/V1beta1AllocationResult.md +docs/V1beta1ApplyConfiguration.md +docs/V1beta1BasicDevice.md +docs/V1beta1CELDeviceSelector.md +docs/V1beta1CapacityRequestPolicy.md +docs/V1beta1CapacityRequestPolicyRange.md +docs/V1beta1CapacityRequirements.md +docs/V1beta1ClusterTrustBundle.md +docs/V1beta1ClusterTrustBundleList.md +docs/V1beta1ClusterTrustBundleSpec.md +docs/V1beta1Counter.md +docs/V1beta1CounterSet.md +docs/V1beta1Device.md +docs/V1beta1DeviceAllocationConfiguration.md +docs/V1beta1DeviceAllocationResult.md +docs/V1beta1DeviceAttribute.md +docs/V1beta1DeviceCapacity.md +docs/V1beta1DeviceClaim.md +docs/V1beta1DeviceClaimConfiguration.md +docs/V1beta1DeviceClass.md +docs/V1beta1DeviceClassConfiguration.md +docs/V1beta1DeviceClassList.md +docs/V1beta1DeviceClassSpec.md +docs/V1beta1DeviceConstraint.md +docs/V1beta1DeviceCounterConsumption.md +docs/V1beta1DeviceRequest.md +docs/V1beta1DeviceRequestAllocationResult.md +docs/V1beta1DeviceSelector.md +docs/V1beta1DeviceSubRequest.md +docs/V1beta1DeviceTaint.md +docs/V1beta1DeviceToleration.md +docs/V1beta1IPAddress.md +docs/V1beta1IPAddressList.md +docs/V1beta1IPAddressSpec.md +docs/V1beta1JSONPatch.md +docs/V1beta1LeaseCandidate.md +docs/V1beta1LeaseCandidateList.md +docs/V1beta1LeaseCandidateSpec.md +docs/V1beta1MatchCondition.md +docs/V1beta1MatchResources.md +docs/V1beta1MutatingAdmissionPolicy.md +docs/V1beta1MutatingAdmissionPolicyBinding.md +docs/V1beta1MutatingAdmissionPolicyBindingList.md +docs/V1beta1MutatingAdmissionPolicyBindingSpec.md +docs/V1beta1MutatingAdmissionPolicyList.md +docs/V1beta1MutatingAdmissionPolicySpec.md +docs/V1beta1Mutation.md +docs/V1beta1NamedRuleWithOperations.md +docs/V1beta1NetworkDeviceData.md +docs/V1beta1OpaqueDeviceConfiguration.md +docs/V1beta1ParamKind.md +docs/V1beta1ParamRef.md +docs/V1beta1ParentReference.md +docs/V1beta1PodCertificateRequest.md +docs/V1beta1PodCertificateRequestList.md +docs/V1beta1PodCertificateRequestSpec.md +docs/V1beta1PodCertificateRequestStatus.md +docs/V1beta1ResourceClaim.md +docs/V1beta1ResourceClaimConsumerReference.md +docs/V1beta1ResourceClaimList.md +docs/V1beta1ResourceClaimSpec.md +docs/V1beta1ResourceClaimStatus.md +docs/V1beta1ResourceClaimTemplate.md +docs/V1beta1ResourceClaimTemplateList.md +docs/V1beta1ResourceClaimTemplateSpec.md +docs/V1beta1ResourcePool.md +docs/V1beta1ResourceSlice.md +docs/V1beta1ResourceSliceList.md +docs/V1beta1ResourceSliceSpec.md +docs/V1beta1ServiceCIDR.md +docs/V1beta1ServiceCIDRList.md +docs/V1beta1ServiceCIDRSpec.md +docs/V1beta1ServiceCIDRStatus.md +docs/V1beta1StorageVersionMigration.md +docs/V1beta1StorageVersionMigrationList.md +docs/V1beta1StorageVersionMigrationSpec.md +docs/V1beta1StorageVersionMigrationStatus.md +docs/V1beta1Variable.md +docs/V1beta1VolumeAttributesClass.md +docs/V1beta1VolumeAttributesClassList.md +docs/V1beta2AllocatedDeviceStatus.md +docs/V1beta2AllocationResult.md +docs/V1beta2CELDeviceSelector.md +docs/V1beta2CapacityRequestPolicy.md +docs/V1beta2CapacityRequestPolicyRange.md +docs/V1beta2CapacityRequirements.md +docs/V1beta2Counter.md +docs/V1beta2CounterSet.md +docs/V1beta2Device.md +docs/V1beta2DeviceAllocationConfiguration.md +docs/V1beta2DeviceAllocationResult.md +docs/V1beta2DeviceAttribute.md +docs/V1beta2DeviceCapacity.md +docs/V1beta2DeviceClaim.md +docs/V1beta2DeviceClaimConfiguration.md +docs/V1beta2DeviceClass.md +docs/V1beta2DeviceClassConfiguration.md +docs/V1beta2DeviceClassList.md +docs/V1beta2DeviceClassSpec.md +docs/V1beta2DeviceConstraint.md +docs/V1beta2DeviceCounterConsumption.md +docs/V1beta2DeviceRequest.md +docs/V1beta2DeviceRequestAllocationResult.md +docs/V1beta2DeviceSelector.md +docs/V1beta2DeviceSubRequest.md +docs/V1beta2DeviceTaint.md +docs/V1beta2DeviceToleration.md +docs/V1beta2ExactDeviceRequest.md +docs/V1beta2NetworkDeviceData.md +docs/V1beta2OpaqueDeviceConfiguration.md +docs/V1beta2ResourceClaim.md +docs/V1beta2ResourceClaimConsumerReference.md +docs/V1beta2ResourceClaimList.md +docs/V1beta2ResourceClaimSpec.md +docs/V1beta2ResourceClaimStatus.md +docs/V1beta2ResourceClaimTemplate.md +docs/V1beta2ResourceClaimTemplateList.md +docs/V1beta2ResourceClaimTemplateSpec.md +docs/V1beta2ResourcePool.md +docs/V1beta2ResourceSlice.md +docs/V1beta2ResourceSliceList.md +docs/V1beta2ResourceSliceSpec.md +docs/V2APIGroupDiscovery.md +docs/V2APIGroupDiscoveryList.md +docs/V2APIResourceDiscovery.md +docs/V2APISubresourceDiscovery.md +docs/V2APIVersionDiscovery.md +docs/V2ContainerResourceMetricSource.md +docs/V2ContainerResourceMetricStatus.md +docs/V2CrossVersionObjectReference.md +docs/V2ExternalMetricSource.md +docs/V2ExternalMetricStatus.md +docs/V2HPAScalingPolicy.md +docs/V2HPAScalingRules.md +docs/V2HorizontalPodAutoscaler.md +docs/V2HorizontalPodAutoscalerBehavior.md +docs/V2HorizontalPodAutoscalerCondition.md +docs/V2HorizontalPodAutoscalerList.md +docs/V2HorizontalPodAutoscalerSpec.md +docs/V2HorizontalPodAutoscalerStatus.md +docs/V2MetricIdentifier.md +docs/V2MetricSpec.md +docs/V2MetricStatus.md +docs/V2MetricTarget.md +docs/V2MetricValueStatus.md +docs/V2ObjectMetricSource.md +docs/V2ObjectMetricStatus.md +docs/V2PodsMetricSource.md +docs/V2PodsMetricStatus.md +docs/V2ResourceMetricSource.md +docs/V2ResourceMetricStatus.md +docs/V2beta1APIGroupDiscovery.md +docs/V2beta1APIGroupDiscoveryList.md +docs/V2beta1APIResourceDiscovery.md +docs/V2beta1APISubresourceDiscovery.md +docs/V2beta1APIVersionDiscovery.md +docs/VersionApi.md +docs/VersionInfo.md +docs/WellKnownApi.md +git_push.sh +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_admissionregistration_api.py +test/test_admissionregistration_v1_api.py +test/test_admissionregistration_v1_service_reference.py +test/test_admissionregistration_v1_webhook_client_config.py +test/test_admissionregistration_v1alpha1_api.py +test/test_admissionregistration_v1beta1_api.py +test/test_apiextensions_api.py +test/test_apiextensions_v1_api.py +test/test_apiextensions_v1_service_reference.py +test/test_apiextensions_v1_webhook_client_config.py +test/test_apiregistration_api.py +test/test_apiregistration_v1_api.py +test/test_apiregistration_v1_service_reference.py +test/test_apis_api.py +test/test_apps_api.py +test/test_apps_v1_api.py +test/test_authentication_api.py +test/test_authentication_v1_api.py +test/test_authentication_v1_token_request.py +test/test_authorization_api.py +test/test_authorization_v1_api.py +test/test_autoscaling_api.py +test/test_autoscaling_v1_api.py +test/test_autoscaling_v2_api.py +test/test_batch_api.py +test/test_batch_v1_api.py +test/test_certificates_api.py +test/test_certificates_v1_api.py +test/test_certificates_v1alpha1_api.py +test/test_certificates_v1beta1_api.py +test/test_coordination_api.py +test/test_coordination_v1_api.py +test/test_coordination_v1alpha2_api.py +test/test_coordination_v1beta1_api.py +test/test_core_api.py +test/test_core_v1_api.py +test/test_core_v1_endpoint_port.py +test/test_core_v1_event.py +test/test_core_v1_event_list.py +test/test_core_v1_event_series.py +test/test_core_v1_resource_claim.py +test/test_custom_objects_api.py +test/test_discovery_api.py +test/test_discovery_v1_api.py +test/test_discovery_v1_endpoint_port.py +test/test_events_api.py +test/test_events_v1_api.py +test/test_events_v1_event.py +test/test_events_v1_event_list.py +test/test_events_v1_event_series.py +test/test_flowcontrol_apiserver_api.py +test/test_flowcontrol_apiserver_v1_api.py +test/test_flowcontrol_v1_subject.py +test/test_internal_apiserver_api.py +test/test_internal_apiserver_v1alpha1_api.py +test/test_logs_api.py +test/test_networking_api.py +test/test_networking_v1_api.py +test/test_networking_v1beta1_api.py +test/test_node_api.py +test/test_node_v1_api.py +test/test_openid_api.py +test/test_policy_api.py +test/test_policy_v1_api.py +test/test_rbac_authorization_api.py +test/test_rbac_authorization_v1_api.py +test/test_rbac_v1_subject.py +test/test_resource_api.py +test/test_resource_v1_api.py +test/test_resource_v1_resource_claim.py +test/test_resource_v1alpha3_api.py +test/test_resource_v1beta1_api.py +test/test_resource_v1beta2_api.py +test/test_scheduling_api.py +test/test_scheduling_v1_api.py +test/test_scheduling_v1alpha1_api.py +test/test_storage_api.py +test/test_storage_v1_api.py +test/test_storage_v1_token_request.py +test/test_storage_v1beta1_api.py +test/test_storagemigration_api.py +test/test_storagemigration_v1beta1_api.py +test/test_v1_affinity.py +test/test_v1_aggregation_rule.py +test/test_v1_allocated_device_status.py +test/test_v1_allocation_result.py +test/test_v1_api_group.py +test/test_v1_api_group_list.py +test/test_v1_api_resource.py +test/test_v1_api_resource_list.py +test/test_v1_api_service.py +test/test_v1_api_service_condition.py +test/test_v1_api_service_list.py +test/test_v1_api_service_spec.py +test/test_v1_api_service_status.py +test/test_v1_api_versions.py +test/test_v1_app_armor_profile.py +test/test_v1_attached_volume.py +test/test_v1_audit_annotation.py +test/test_v1_aws_elastic_block_store_volume_source.py +test/test_v1_azure_disk_volume_source.py +test/test_v1_azure_file_persistent_volume_source.py +test/test_v1_azure_file_volume_source.py +test/test_v1_binding.py +test/test_v1_bound_object_reference.py +test/test_v1_capabilities.py +test/test_v1_capacity_request_policy.py +test/test_v1_capacity_request_policy_range.py +test/test_v1_capacity_requirements.py +test/test_v1_cel_device_selector.py +test/test_v1_ceph_fs_persistent_volume_source.py +test/test_v1_ceph_fs_volume_source.py +test/test_v1_certificate_signing_request.py +test/test_v1_certificate_signing_request_condition.py +test/test_v1_certificate_signing_request_list.py +test/test_v1_certificate_signing_request_spec.py +test/test_v1_certificate_signing_request_status.py +test/test_v1_cinder_persistent_volume_source.py +test/test_v1_cinder_volume_source.py +test/test_v1_client_ip_config.py +test/test_v1_cluster_role.py +test/test_v1_cluster_role_binding.py +test/test_v1_cluster_role_binding_list.py +test/test_v1_cluster_role_list.py +test/test_v1_cluster_trust_bundle_projection.py +test/test_v1_component_condition.py +test/test_v1_component_status.py +test/test_v1_component_status_list.py +test/test_v1_condition.py +test/test_v1_config_map.py +test/test_v1_config_map_env_source.py +test/test_v1_config_map_key_selector.py +test/test_v1_config_map_list.py +test/test_v1_config_map_node_config_source.py +test/test_v1_config_map_projection.py +test/test_v1_config_map_volume_source.py +test/test_v1_container.py +test/test_v1_container_extended_resource_request.py +test/test_v1_container_image.py +test/test_v1_container_port.py +test/test_v1_container_resize_policy.py +test/test_v1_container_restart_rule.py +test/test_v1_container_restart_rule_on_exit_codes.py +test/test_v1_container_state.py +test/test_v1_container_state_running.py +test/test_v1_container_state_terminated.py +test/test_v1_container_state_waiting.py +test/test_v1_container_status.py +test/test_v1_container_user.py +test/test_v1_controller_revision.py +test/test_v1_controller_revision_list.py +test/test_v1_counter.py +test/test_v1_counter_set.py +test/test_v1_cron_job.py +test/test_v1_cron_job_list.py +test/test_v1_cron_job_spec.py +test/test_v1_cron_job_status.py +test/test_v1_cross_version_object_reference.py +test/test_v1_csi_driver.py +test/test_v1_csi_driver_list.py +test/test_v1_csi_driver_spec.py +test/test_v1_csi_node.py +test/test_v1_csi_node_driver.py +test/test_v1_csi_node_list.py +test/test_v1_csi_node_spec.py +test/test_v1_csi_persistent_volume_source.py +test/test_v1_csi_storage_capacity.py +test/test_v1_csi_storage_capacity_list.py +test/test_v1_csi_volume_source.py +test/test_v1_custom_resource_column_definition.py +test/test_v1_custom_resource_conversion.py +test/test_v1_custom_resource_definition.py +test/test_v1_custom_resource_definition_condition.py +test/test_v1_custom_resource_definition_list.py +test/test_v1_custom_resource_definition_names.py +test/test_v1_custom_resource_definition_spec.py +test/test_v1_custom_resource_definition_status.py +test/test_v1_custom_resource_definition_version.py +test/test_v1_custom_resource_subresource_scale.py +test/test_v1_custom_resource_subresources.py +test/test_v1_custom_resource_validation.py +test/test_v1_daemon_endpoint.py +test/test_v1_daemon_set.py +test/test_v1_daemon_set_condition.py +test/test_v1_daemon_set_list.py +test/test_v1_daemon_set_spec.py +test/test_v1_daemon_set_status.py +test/test_v1_daemon_set_update_strategy.py +test/test_v1_delete_options.py +test/test_v1_deployment.py +test/test_v1_deployment_condition.py +test/test_v1_deployment_list.py +test/test_v1_deployment_spec.py +test/test_v1_deployment_status.py +test/test_v1_deployment_strategy.py +test/test_v1_device.py +test/test_v1_device_allocation_configuration.py +test/test_v1_device_allocation_result.py +test/test_v1_device_attribute.py +test/test_v1_device_capacity.py +test/test_v1_device_claim.py +test/test_v1_device_claim_configuration.py +test/test_v1_device_class.py +test/test_v1_device_class_configuration.py +test/test_v1_device_class_list.py +test/test_v1_device_class_spec.py +test/test_v1_device_constraint.py +test/test_v1_device_counter_consumption.py +test/test_v1_device_request.py +test/test_v1_device_request_allocation_result.py +test/test_v1_device_selector.py +test/test_v1_device_sub_request.py +test/test_v1_device_taint.py +test/test_v1_device_toleration.py +test/test_v1_downward_api_projection.py +test/test_v1_downward_api_volume_file.py +test/test_v1_downward_api_volume_source.py +test/test_v1_empty_dir_volume_source.py +test/test_v1_endpoint.py +test/test_v1_endpoint_address.py +test/test_v1_endpoint_conditions.py +test/test_v1_endpoint_hints.py +test/test_v1_endpoint_slice.py +test/test_v1_endpoint_slice_list.py +test/test_v1_endpoint_subset.py +test/test_v1_endpoints.py +test/test_v1_endpoints_list.py +test/test_v1_env_from_source.py +test/test_v1_env_var.py +test/test_v1_env_var_source.py +test/test_v1_ephemeral_container.py +test/test_v1_ephemeral_volume_source.py +test/test_v1_event_source.py +test/test_v1_eviction.py +test/test_v1_exact_device_request.py +test/test_v1_exec_action.py +test/test_v1_exempt_priority_level_configuration.py +test/test_v1_expression_warning.py +test/test_v1_external_documentation.py +test/test_v1_fc_volume_source.py +test/test_v1_field_selector_attributes.py +test/test_v1_field_selector_requirement.py +test/test_v1_file_key_selector.py +test/test_v1_flex_persistent_volume_source.py +test/test_v1_flex_volume_source.py +test/test_v1_flocker_volume_source.py +test/test_v1_flow_distinguisher_method.py +test/test_v1_flow_schema.py +test/test_v1_flow_schema_condition.py +test/test_v1_flow_schema_list.py +test/test_v1_flow_schema_spec.py +test/test_v1_flow_schema_status.py +test/test_v1_for_node.py +test/test_v1_for_zone.py +test/test_v1_gce_persistent_disk_volume_source.py +test/test_v1_git_repo_volume_source.py +test/test_v1_glusterfs_persistent_volume_source.py +test/test_v1_glusterfs_volume_source.py +test/test_v1_group_resource.py +test/test_v1_group_subject.py +test/test_v1_group_version_for_discovery.py +test/test_v1_grpc_action.py +test/test_v1_horizontal_pod_autoscaler.py +test/test_v1_horizontal_pod_autoscaler_list.py +test/test_v1_horizontal_pod_autoscaler_spec.py +test/test_v1_horizontal_pod_autoscaler_status.py +test/test_v1_host_alias.py +test/test_v1_host_ip.py +test/test_v1_host_path_volume_source.py +test/test_v1_http_get_action.py +test/test_v1_http_header.py +test/test_v1_http_ingress_path.py +test/test_v1_http_ingress_rule_value.py +test/test_v1_image_volume_source.py +test/test_v1_ingress.py +test/test_v1_ingress_backend.py +test/test_v1_ingress_class.py +test/test_v1_ingress_class_list.py +test/test_v1_ingress_class_parameters_reference.py +test/test_v1_ingress_class_spec.py +test/test_v1_ingress_list.py +test/test_v1_ingress_load_balancer_ingress.py +test/test_v1_ingress_load_balancer_status.py +test/test_v1_ingress_port_status.py +test/test_v1_ingress_rule.py +test/test_v1_ingress_service_backend.py +test/test_v1_ingress_spec.py +test/test_v1_ingress_status.py +test/test_v1_ingress_tls.py +test/test_v1_ip_address.py +test/test_v1_ip_address_list.py +test/test_v1_ip_address_spec.py +test/test_v1_ip_block.py +test/test_v1_iscsi_persistent_volume_source.py +test/test_v1_iscsi_volume_source.py +test/test_v1_job.py +test/test_v1_job_condition.py +test/test_v1_job_list.py +test/test_v1_job_spec.py +test/test_v1_job_status.py +test/test_v1_job_template_spec.py +test/test_v1_json_schema_props.py +test/test_v1_key_to_path.py +test/test_v1_label_selector.py +test/test_v1_label_selector_attributes.py +test/test_v1_label_selector_requirement.py +test/test_v1_lease.py +test/test_v1_lease_list.py +test/test_v1_lease_spec.py +test/test_v1_lifecycle.py +test/test_v1_lifecycle_handler.py +test/test_v1_limit_range.py +test/test_v1_limit_range_item.py +test/test_v1_limit_range_list.py +test/test_v1_limit_range_spec.py +test/test_v1_limit_response.py +test/test_v1_limited_priority_level_configuration.py +test/test_v1_linux_container_user.py +test/test_v1_list_meta.py +test/test_v1_load_balancer_ingress.py +test/test_v1_load_balancer_status.py +test/test_v1_local_object_reference.py +test/test_v1_local_subject_access_review.py +test/test_v1_local_volume_source.py +test/test_v1_managed_fields_entry.py +test/test_v1_match_condition.py +test/test_v1_match_resources.py +test/test_v1_modify_volume_status.py +test/test_v1_mutating_webhook.py +test/test_v1_mutating_webhook_configuration.py +test/test_v1_mutating_webhook_configuration_list.py +test/test_v1_named_rule_with_operations.py +test/test_v1_namespace.py +test/test_v1_namespace_condition.py +test/test_v1_namespace_list.py +test/test_v1_namespace_spec.py +test/test_v1_namespace_status.py +test/test_v1_network_device_data.py +test/test_v1_network_policy.py +test/test_v1_network_policy_egress_rule.py +test/test_v1_network_policy_ingress_rule.py +test/test_v1_network_policy_list.py +test/test_v1_network_policy_peer.py +test/test_v1_network_policy_port.py +test/test_v1_network_policy_spec.py +test/test_v1_nfs_volume_source.py +test/test_v1_node.py +test/test_v1_node_address.py +test/test_v1_node_affinity.py +test/test_v1_node_condition.py +test/test_v1_node_config_source.py +test/test_v1_node_config_status.py +test/test_v1_node_daemon_endpoints.py +test/test_v1_node_features.py +test/test_v1_node_list.py +test/test_v1_node_runtime_handler.py +test/test_v1_node_runtime_handler_features.py +test/test_v1_node_selector.py +test/test_v1_node_selector_requirement.py +test/test_v1_node_selector_term.py +test/test_v1_node_spec.py +test/test_v1_node_status.py +test/test_v1_node_swap_status.py +test/test_v1_node_system_info.py +test/test_v1_non_resource_attributes.py +test/test_v1_non_resource_policy_rule.py +test/test_v1_non_resource_rule.py +test/test_v1_object_field_selector.py +test/test_v1_object_meta.py +test/test_v1_object_reference.py +test/test_v1_opaque_device_configuration.py +test/test_v1_overhead.py +test/test_v1_owner_reference.py +test/test_v1_param_kind.py +test/test_v1_param_ref.py +test/test_v1_parent_reference.py +test/test_v1_persistent_volume.py +test/test_v1_persistent_volume_claim.py +test/test_v1_persistent_volume_claim_condition.py +test/test_v1_persistent_volume_claim_list.py +test/test_v1_persistent_volume_claim_spec.py +test/test_v1_persistent_volume_claim_status.py +test/test_v1_persistent_volume_claim_template.py +test/test_v1_persistent_volume_claim_volume_source.py +test/test_v1_persistent_volume_list.py +test/test_v1_persistent_volume_spec.py +test/test_v1_persistent_volume_status.py +test/test_v1_photon_persistent_disk_volume_source.py +test/test_v1_pod.py +test/test_v1_pod_affinity.py +test/test_v1_pod_affinity_term.py +test/test_v1_pod_anti_affinity.py +test/test_v1_pod_certificate_projection.py +test/test_v1_pod_condition.py +test/test_v1_pod_disruption_budget.py +test/test_v1_pod_disruption_budget_list.py +test/test_v1_pod_disruption_budget_spec.py +test/test_v1_pod_disruption_budget_status.py +test/test_v1_pod_dns_config.py +test/test_v1_pod_dns_config_option.py +test/test_v1_pod_extended_resource_claim_status.py +test/test_v1_pod_failure_policy.py +test/test_v1_pod_failure_policy_on_exit_codes_requirement.py +test/test_v1_pod_failure_policy_on_pod_conditions_pattern.py +test/test_v1_pod_failure_policy_rule.py +test/test_v1_pod_ip.py +test/test_v1_pod_list.py +test/test_v1_pod_os.py +test/test_v1_pod_readiness_gate.py +test/test_v1_pod_resource_claim.py +test/test_v1_pod_resource_claim_status.py +test/test_v1_pod_scheduling_gate.py +test/test_v1_pod_security_context.py +test/test_v1_pod_spec.py +test/test_v1_pod_status.py +test/test_v1_pod_template.py +test/test_v1_pod_template_list.py +test/test_v1_pod_template_spec.py +test/test_v1_policy_rule.py +test/test_v1_policy_rules_with_subjects.py +test/test_v1_port_status.py +test/test_v1_portworx_volume_source.py +test/test_v1_preconditions.py +test/test_v1_preferred_scheduling_term.py +test/test_v1_priority_class.py +test/test_v1_priority_class_list.py +test/test_v1_priority_level_configuration.py +test/test_v1_priority_level_configuration_condition.py +test/test_v1_priority_level_configuration_list.py +test/test_v1_priority_level_configuration_reference.py +test/test_v1_priority_level_configuration_spec.py +test/test_v1_priority_level_configuration_status.py +test/test_v1_probe.py +test/test_v1_projected_volume_source.py +test/test_v1_queuing_configuration.py +test/test_v1_quobyte_volume_source.py +test/test_v1_rbd_persistent_volume_source.py +test/test_v1_rbd_volume_source.py +test/test_v1_replica_set.py +test/test_v1_replica_set_condition.py +test/test_v1_replica_set_list.py +test/test_v1_replica_set_spec.py +test/test_v1_replica_set_status.py +test/test_v1_replication_controller.py +test/test_v1_replication_controller_condition.py +test/test_v1_replication_controller_list.py +test/test_v1_replication_controller_spec.py +test/test_v1_replication_controller_status.py +test/test_v1_resource_attributes.py +test/test_v1_resource_claim_consumer_reference.py +test/test_v1_resource_claim_list.py +test/test_v1_resource_claim_spec.py +test/test_v1_resource_claim_status.py +test/test_v1_resource_claim_template.py +test/test_v1_resource_claim_template_list.py +test/test_v1_resource_claim_template_spec.py +test/test_v1_resource_field_selector.py +test/test_v1_resource_health.py +test/test_v1_resource_policy_rule.py +test/test_v1_resource_pool.py +test/test_v1_resource_quota.py +test/test_v1_resource_quota_list.py +test/test_v1_resource_quota_spec.py +test/test_v1_resource_quota_status.py +test/test_v1_resource_requirements.py +test/test_v1_resource_rule.py +test/test_v1_resource_slice.py +test/test_v1_resource_slice_list.py +test/test_v1_resource_slice_spec.py +test/test_v1_resource_status.py +test/test_v1_role.py +test/test_v1_role_binding.py +test/test_v1_role_binding_list.py +test/test_v1_role_list.py +test/test_v1_role_ref.py +test/test_v1_rolling_update_daemon_set.py +test/test_v1_rolling_update_deployment.py +test/test_v1_rolling_update_stateful_set_strategy.py +test/test_v1_rule_with_operations.py +test/test_v1_runtime_class.py +test/test_v1_runtime_class_list.py +test/test_v1_scale.py +test/test_v1_scale_io_persistent_volume_source.py +test/test_v1_scale_io_volume_source.py +test/test_v1_scale_spec.py +test/test_v1_scale_status.py +test/test_v1_scheduling.py +test/test_v1_scope_selector.py +test/test_v1_scoped_resource_selector_requirement.py +test/test_v1_se_linux_options.py +test/test_v1_seccomp_profile.py +test/test_v1_secret.py +test/test_v1_secret_env_source.py +test/test_v1_secret_key_selector.py +test/test_v1_secret_list.py +test/test_v1_secret_projection.py +test/test_v1_secret_reference.py +test/test_v1_secret_volume_source.py +test/test_v1_security_context.py +test/test_v1_selectable_field.py +test/test_v1_self_subject_access_review.py +test/test_v1_self_subject_access_review_spec.py +test/test_v1_self_subject_review.py +test/test_v1_self_subject_review_status.py +test/test_v1_self_subject_rules_review.py +test/test_v1_self_subject_rules_review_spec.py +test/test_v1_server_address_by_client_cidr.py +test/test_v1_service.py +test/test_v1_service_account.py +test/test_v1_service_account_list.py +test/test_v1_service_account_subject.py +test/test_v1_service_account_token_projection.py +test/test_v1_service_backend_port.py +test/test_v1_service_cidr.py +test/test_v1_service_cidr_list.py +test/test_v1_service_cidr_spec.py +test/test_v1_service_cidr_status.py +test/test_v1_service_list.py +test/test_v1_service_port.py +test/test_v1_service_spec.py +test/test_v1_service_status.py +test/test_v1_session_affinity_config.py +test/test_v1_sleep_action.py +test/test_v1_stateful_set.py +test/test_v1_stateful_set_condition.py +test/test_v1_stateful_set_list.py +test/test_v1_stateful_set_ordinals.py +test/test_v1_stateful_set_persistent_volume_claim_retention_policy.py +test/test_v1_stateful_set_spec.py +test/test_v1_stateful_set_status.py +test/test_v1_stateful_set_update_strategy.py +test/test_v1_status.py +test/test_v1_status_cause.py +test/test_v1_status_details.py +test/test_v1_storage_class.py +test/test_v1_storage_class_list.py +test/test_v1_storage_os_persistent_volume_source.py +test/test_v1_storage_os_volume_source.py +test/test_v1_subject_access_review.py +test/test_v1_subject_access_review_spec.py +test/test_v1_subject_access_review_status.py +test/test_v1_subject_rules_review_status.py +test/test_v1_success_policy.py +test/test_v1_success_policy_rule.py +test/test_v1_sysctl.py +test/test_v1_taint.py +test/test_v1_tcp_socket_action.py +test/test_v1_token_request_spec.py +test/test_v1_token_request_status.py +test/test_v1_token_review.py +test/test_v1_token_review_spec.py +test/test_v1_token_review_status.py +test/test_v1_toleration.py +test/test_v1_topology_selector_label_requirement.py +test/test_v1_topology_selector_term.py +test/test_v1_topology_spread_constraint.py +test/test_v1_type_checking.py +test/test_v1_typed_local_object_reference.py +test/test_v1_typed_object_reference.py +test/test_v1_uncounted_terminated_pods.py +test/test_v1_user_info.py +test/test_v1_user_subject.py +test/test_v1_validating_admission_policy.py +test/test_v1_validating_admission_policy_binding.py +test/test_v1_validating_admission_policy_binding_list.py +test/test_v1_validating_admission_policy_binding_spec.py +test/test_v1_validating_admission_policy_list.py +test/test_v1_validating_admission_policy_spec.py +test/test_v1_validating_admission_policy_status.py +test/test_v1_validating_webhook.py +test/test_v1_validating_webhook_configuration.py +test/test_v1_validating_webhook_configuration_list.py +test/test_v1_validation.py +test/test_v1_validation_rule.py +test/test_v1_variable.py +test/test_v1_volume.py +test/test_v1_volume_attachment.py +test/test_v1_volume_attachment_list.py +test/test_v1_volume_attachment_source.py +test/test_v1_volume_attachment_spec.py +test/test_v1_volume_attachment_status.py +test/test_v1_volume_attributes_class.py +test/test_v1_volume_attributes_class_list.py +test/test_v1_volume_device.py +test/test_v1_volume_error.py +test/test_v1_volume_mount.py +test/test_v1_volume_mount_status.py +test/test_v1_volume_node_affinity.py +test/test_v1_volume_node_resources.py +test/test_v1_volume_projection.py +test/test_v1_volume_resource_requirements.py +test/test_v1_vsphere_virtual_disk_volume_source.py +test/test_v1_watch_event.py +test/test_v1_webhook_conversion.py +test/test_v1_weighted_pod_affinity_term.py +test/test_v1_windows_security_context_options.py +test/test_v1_workload_reference.py +test/test_v1alpha1_apply_configuration.py +test/test_v1alpha1_cluster_trust_bundle.py +test/test_v1alpha1_cluster_trust_bundle_list.py +test/test_v1alpha1_cluster_trust_bundle_spec.py +test/test_v1alpha1_gang_scheduling_policy.py +test/test_v1alpha1_json_patch.py +test/test_v1alpha1_match_condition.py +test/test_v1alpha1_match_resources.py +test/test_v1alpha1_mutating_admission_policy.py +test/test_v1alpha1_mutating_admission_policy_binding.py +test/test_v1alpha1_mutating_admission_policy_binding_list.py +test/test_v1alpha1_mutating_admission_policy_binding_spec.py +test/test_v1alpha1_mutating_admission_policy_list.py +test/test_v1alpha1_mutating_admission_policy_spec.py +test/test_v1alpha1_mutation.py +test/test_v1alpha1_named_rule_with_operations.py +test/test_v1alpha1_param_kind.py +test/test_v1alpha1_param_ref.py +test/test_v1alpha1_pod_group.py +test/test_v1alpha1_pod_group_policy.py +test/test_v1alpha1_server_storage_version.py +test/test_v1alpha1_storage_version.py +test/test_v1alpha1_storage_version_condition.py +test/test_v1alpha1_storage_version_list.py +test/test_v1alpha1_storage_version_status.py +test/test_v1alpha1_typed_local_object_reference.py +test/test_v1alpha1_variable.py +test/test_v1alpha1_workload.py +test/test_v1alpha1_workload_list.py +test/test_v1alpha1_workload_spec.py +test/test_v1alpha2_lease_candidate.py +test/test_v1alpha2_lease_candidate_list.py +test/test_v1alpha2_lease_candidate_spec.py +test/test_v1alpha3_device_taint.py +test/test_v1alpha3_device_taint_rule.py +test/test_v1alpha3_device_taint_rule_list.py +test/test_v1alpha3_device_taint_rule_spec.py +test/test_v1alpha3_device_taint_rule_status.py +test/test_v1alpha3_device_taint_selector.py +test/test_v1beta1_allocated_device_status.py +test/test_v1beta1_allocation_result.py +test/test_v1beta1_apply_configuration.py +test/test_v1beta1_basic_device.py +test/test_v1beta1_capacity_request_policy.py +test/test_v1beta1_capacity_request_policy_range.py +test/test_v1beta1_capacity_requirements.py +test/test_v1beta1_cel_device_selector.py +test/test_v1beta1_cluster_trust_bundle.py +test/test_v1beta1_cluster_trust_bundle_list.py +test/test_v1beta1_cluster_trust_bundle_spec.py +test/test_v1beta1_counter.py +test/test_v1beta1_counter_set.py +test/test_v1beta1_device.py +test/test_v1beta1_device_allocation_configuration.py +test/test_v1beta1_device_allocation_result.py +test/test_v1beta1_device_attribute.py +test/test_v1beta1_device_capacity.py +test/test_v1beta1_device_claim.py +test/test_v1beta1_device_claim_configuration.py +test/test_v1beta1_device_class.py +test/test_v1beta1_device_class_configuration.py +test/test_v1beta1_device_class_list.py +test/test_v1beta1_device_class_spec.py +test/test_v1beta1_device_constraint.py +test/test_v1beta1_device_counter_consumption.py +test/test_v1beta1_device_request.py +test/test_v1beta1_device_request_allocation_result.py +test/test_v1beta1_device_selector.py +test/test_v1beta1_device_sub_request.py +test/test_v1beta1_device_taint.py +test/test_v1beta1_device_toleration.py +test/test_v1beta1_ip_address.py +test/test_v1beta1_ip_address_list.py +test/test_v1beta1_ip_address_spec.py +test/test_v1beta1_json_patch.py +test/test_v1beta1_lease_candidate.py +test/test_v1beta1_lease_candidate_list.py +test/test_v1beta1_lease_candidate_spec.py +test/test_v1beta1_match_condition.py +test/test_v1beta1_match_resources.py +test/test_v1beta1_mutating_admission_policy.py +test/test_v1beta1_mutating_admission_policy_binding.py +test/test_v1beta1_mutating_admission_policy_binding_list.py +test/test_v1beta1_mutating_admission_policy_binding_spec.py +test/test_v1beta1_mutating_admission_policy_list.py +test/test_v1beta1_mutating_admission_policy_spec.py +test/test_v1beta1_mutation.py +test/test_v1beta1_named_rule_with_operations.py +test/test_v1beta1_network_device_data.py +test/test_v1beta1_opaque_device_configuration.py +test/test_v1beta1_param_kind.py +test/test_v1beta1_param_ref.py +test/test_v1beta1_parent_reference.py +test/test_v1beta1_pod_certificate_request.py +test/test_v1beta1_pod_certificate_request_list.py +test/test_v1beta1_pod_certificate_request_spec.py +test/test_v1beta1_pod_certificate_request_status.py +test/test_v1beta1_resource_claim.py +test/test_v1beta1_resource_claim_consumer_reference.py +test/test_v1beta1_resource_claim_list.py +test/test_v1beta1_resource_claim_spec.py +test/test_v1beta1_resource_claim_status.py +test/test_v1beta1_resource_claim_template.py +test/test_v1beta1_resource_claim_template_list.py +test/test_v1beta1_resource_claim_template_spec.py +test/test_v1beta1_resource_pool.py +test/test_v1beta1_resource_slice.py +test/test_v1beta1_resource_slice_list.py +test/test_v1beta1_resource_slice_spec.py +test/test_v1beta1_service_cidr.py +test/test_v1beta1_service_cidr_list.py +test/test_v1beta1_service_cidr_spec.py +test/test_v1beta1_service_cidr_status.py +test/test_v1beta1_storage_version_migration.py +test/test_v1beta1_storage_version_migration_list.py +test/test_v1beta1_storage_version_migration_spec.py +test/test_v1beta1_storage_version_migration_status.py +test/test_v1beta1_variable.py +test/test_v1beta1_volume_attributes_class.py +test/test_v1beta1_volume_attributes_class_list.py +test/test_v1beta2_allocated_device_status.py +test/test_v1beta2_allocation_result.py +test/test_v1beta2_capacity_request_policy.py +test/test_v1beta2_capacity_request_policy_range.py +test/test_v1beta2_capacity_requirements.py +test/test_v1beta2_cel_device_selector.py +test/test_v1beta2_counter.py +test/test_v1beta2_counter_set.py +test/test_v1beta2_device.py +test/test_v1beta2_device_allocation_configuration.py +test/test_v1beta2_device_allocation_result.py +test/test_v1beta2_device_attribute.py +test/test_v1beta2_device_capacity.py +test/test_v1beta2_device_claim.py +test/test_v1beta2_device_claim_configuration.py +test/test_v1beta2_device_class.py +test/test_v1beta2_device_class_configuration.py +test/test_v1beta2_device_class_list.py +test/test_v1beta2_device_class_spec.py +test/test_v1beta2_device_constraint.py +test/test_v1beta2_device_counter_consumption.py +test/test_v1beta2_device_request.py +test/test_v1beta2_device_request_allocation_result.py +test/test_v1beta2_device_selector.py +test/test_v1beta2_device_sub_request.py +test/test_v1beta2_device_taint.py +test/test_v1beta2_device_toleration.py +test/test_v1beta2_exact_device_request.py +test/test_v1beta2_network_device_data.py +test/test_v1beta2_opaque_device_configuration.py +test/test_v1beta2_resource_claim.py +test/test_v1beta2_resource_claim_consumer_reference.py +test/test_v1beta2_resource_claim_list.py +test/test_v1beta2_resource_claim_spec.py +test/test_v1beta2_resource_claim_status.py +test/test_v1beta2_resource_claim_template.py +test/test_v1beta2_resource_claim_template_list.py +test/test_v1beta2_resource_claim_template_spec.py +test/test_v1beta2_resource_pool.py +test/test_v1beta2_resource_slice.py +test/test_v1beta2_resource_slice_list.py +test/test_v1beta2_resource_slice_spec.py +test/test_v2_api_group_discovery.py +test/test_v2_api_group_discovery_list.py +test/test_v2_api_resource_discovery.py +test/test_v2_api_subresource_discovery.py +test/test_v2_api_version_discovery.py +test/test_v2_container_resource_metric_source.py +test/test_v2_container_resource_metric_status.py +test/test_v2_cross_version_object_reference.py +test/test_v2_external_metric_source.py +test/test_v2_external_metric_status.py +test/test_v2_horizontal_pod_autoscaler.py +test/test_v2_horizontal_pod_autoscaler_behavior.py +test/test_v2_horizontal_pod_autoscaler_condition.py +test/test_v2_horizontal_pod_autoscaler_list.py +test/test_v2_horizontal_pod_autoscaler_spec.py +test/test_v2_horizontal_pod_autoscaler_status.py +test/test_v2_hpa_scaling_policy.py +test/test_v2_hpa_scaling_rules.py +test/test_v2_metric_identifier.py +test/test_v2_metric_spec.py +test/test_v2_metric_status.py +test/test_v2_metric_target.py +test/test_v2_metric_value_status.py +test/test_v2_object_metric_source.py +test/test_v2_object_metric_status.py +test/test_v2_pods_metric_source.py +test/test_v2_pods_metric_status.py +test/test_v2_resource_metric_source.py +test/test_v2_resource_metric_status.py +test/test_v2beta1_api_group_discovery.py +test/test_v2beta1_api_group_discovery_list.py +test/test_v2beta1_api_resource_discovery.py +test/test_v2beta1_api_subresource_discovery.py +test/test_v2beta1_api_version_discovery.py +test/test_version_api.py +test/test_version_info.py +test/test_well_known_api.py +tox.ini diff --git a/kubernetes_asyncio/.openapi-generator/VERSION b/kubernetes_asyncio/.openapi-generator/VERSION new file mode 100644 index 0000000000..cd802a1ec4 --- /dev/null +++ b/kubernetes_asyncio/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/kubernetes_asyncio/.openapi-generator/swagger.json-default.sha256 b/kubernetes_asyncio/.openapi-generator/swagger.json-default.sha256 new file mode 100644 index 0000000000..2fd73dc6da --- /dev/null +++ b/kubernetes_asyncio/.openapi-generator/swagger.json-default.sha256 @@ -0,0 +1 @@ +550c55f434bcea9a33b26c3dd2fae687acbf0fc36dc0031bb6858be079ca138b \ No newline at end of file diff --git a/kubernetes_asyncio/.travis.yml b/kubernetes_asyncio/.travis.yml new file mode 100644 index 0000000000..2cc5b084e6 --- /dev/null +++ b/kubernetes_asyncio/.travis.yml @@ -0,0 +1,17 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "2.7" + - "3.2" + - "3.3" + - "3.4" + - "3.5" + - "3.6" + - "3.7" + - "3.8" +# command to install dependencies +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" +# command to run tests +script: pytest --cov=client diff --git a/kubernetes_asyncio/README.md b/kubernetes_asyncio/README.md new file mode 100644 index 0000000000..ea0f82cced --- /dev/null +++ b/kubernetes_asyncio/README.md @@ -0,0 +1,1737 @@ +# kubernetes_asyncio.client +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: release-1.35 +- Package version: 35.0.0+snapshot +- Build package: org.openapitools.codegen.languages.PythonLegacyClientCodegen + +## Requirements. + +Python 2.7 and 3.4+ + +## Installation & Usage +### pip install + +If the python package is hosted on a repository, you can install directly using: + +```sh +pip install git+https://github.com/kubernetes-kubernetes_asyncio.client/python.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/kubernetes-kubernetes_asyncio.client/python.git`) + +Then import the package: +```python +import kubernetes_asyncio.client +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import kubernetes_asyncio.client +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python +from __future__ import print_function + +import time +import kubernetes_asyncio.client +from kubernetes_asyncio.client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = kubernetes_asyncio.client.Configuration( + host = "http://localhost" +) + +# The kubernetes_asyncio.client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: BearerToken +configuration.api_key['BearerToken'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['BearerToken'] = 'Bearer' + + +# Enter a context with an instance of the API kubernetes_asyncio.client +async with kubernetes_asyncio.client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = kubernetes_asyncio.client.WellKnownApi(api_client) + + try: + api_response = await api_instance.get_service_account_issuer_open_id_configuration() + pprint(api_response) + except ApiException as e: + print("Exception when calling WellKnownApi->get_service_account_issuer_open_id_configuration: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*WellKnownApi* | [**get_service_account_issuer_open_id_configuration**](docs/WellKnownApi.md#get_service_account_issuer_open_id_configuration) | **GET** /.well-known/openid-configuration | +*AdmissionregistrationApi* | [**get_api_group**](docs/AdmissionregistrationApi.md#get_api_group) | **GET** /apis/admissionregistration.k8s.io/ | +*AdmissionregistrationV1Api* | [**create_mutating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#create_mutating_webhook_configuration) | **POST** /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations | +*AdmissionregistrationV1Api* | [**create_validating_admission_policy**](docs/AdmissionregistrationV1Api.md#create_validating_admission_policy) | **POST** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies | +*AdmissionregistrationV1Api* | [**create_validating_admission_policy_binding**](docs/AdmissionregistrationV1Api.md#create_validating_admission_policy_binding) | **POST** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings | +*AdmissionregistrationV1Api* | [**create_validating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#create_validating_webhook_configuration) | **POST** /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations | +*AdmissionregistrationV1Api* | [**delete_collection_mutating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#delete_collection_mutating_webhook_configuration) | **DELETE** /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations | +*AdmissionregistrationV1Api* | [**delete_collection_validating_admission_policy**](docs/AdmissionregistrationV1Api.md#delete_collection_validating_admission_policy) | **DELETE** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies | +*AdmissionregistrationV1Api* | [**delete_collection_validating_admission_policy_binding**](docs/AdmissionregistrationV1Api.md#delete_collection_validating_admission_policy_binding) | **DELETE** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings | +*AdmissionregistrationV1Api* | [**delete_collection_validating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#delete_collection_validating_webhook_configuration) | **DELETE** /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations | +*AdmissionregistrationV1Api* | [**delete_mutating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#delete_mutating_webhook_configuration) | **DELETE** /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name} | +*AdmissionregistrationV1Api* | [**delete_validating_admission_policy**](docs/AdmissionregistrationV1Api.md#delete_validating_admission_policy) | **DELETE** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name} | +*AdmissionregistrationV1Api* | [**delete_validating_admission_policy_binding**](docs/AdmissionregistrationV1Api.md#delete_validating_admission_policy_binding) | **DELETE** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1Api* | [**delete_validating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#delete_validating_webhook_configuration) | **DELETE** /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name} | +*AdmissionregistrationV1Api* | [**get_api_resources**](docs/AdmissionregistrationV1Api.md#get_api_resources) | **GET** /apis/admissionregistration.k8s.io/v1/ | +*AdmissionregistrationV1Api* | [**list_mutating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#list_mutating_webhook_configuration) | **GET** /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations | +*AdmissionregistrationV1Api* | [**list_validating_admission_policy**](docs/AdmissionregistrationV1Api.md#list_validating_admission_policy) | **GET** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies | +*AdmissionregistrationV1Api* | [**list_validating_admission_policy_binding**](docs/AdmissionregistrationV1Api.md#list_validating_admission_policy_binding) | **GET** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings | +*AdmissionregistrationV1Api* | [**list_validating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#list_validating_webhook_configuration) | **GET** /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations | +*AdmissionregistrationV1Api* | [**patch_mutating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#patch_mutating_webhook_configuration) | **PATCH** /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name} | +*AdmissionregistrationV1Api* | [**patch_validating_admission_policy**](docs/AdmissionregistrationV1Api.md#patch_validating_admission_policy) | **PATCH** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name} | +*AdmissionregistrationV1Api* | [**patch_validating_admission_policy_binding**](docs/AdmissionregistrationV1Api.md#patch_validating_admission_policy_binding) | **PATCH** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1Api* | [**patch_validating_admission_policy_status**](docs/AdmissionregistrationV1Api.md#patch_validating_admission_policy_status) | **PATCH** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status | +*AdmissionregistrationV1Api* | [**patch_validating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#patch_validating_webhook_configuration) | **PATCH** /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name} | +*AdmissionregistrationV1Api* | [**read_mutating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#read_mutating_webhook_configuration) | **GET** /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name} | +*AdmissionregistrationV1Api* | [**read_validating_admission_policy**](docs/AdmissionregistrationV1Api.md#read_validating_admission_policy) | **GET** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name} | +*AdmissionregistrationV1Api* | [**read_validating_admission_policy_binding**](docs/AdmissionregistrationV1Api.md#read_validating_admission_policy_binding) | **GET** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1Api* | [**read_validating_admission_policy_status**](docs/AdmissionregistrationV1Api.md#read_validating_admission_policy_status) | **GET** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status | +*AdmissionregistrationV1Api* | [**read_validating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#read_validating_webhook_configuration) | **GET** /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name} | +*AdmissionregistrationV1Api* | [**replace_mutating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#replace_mutating_webhook_configuration) | **PUT** /apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name} | +*AdmissionregistrationV1Api* | [**replace_validating_admission_policy**](docs/AdmissionregistrationV1Api.md#replace_validating_admission_policy) | **PUT** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name} | +*AdmissionregistrationV1Api* | [**replace_validating_admission_policy_binding**](docs/AdmissionregistrationV1Api.md#replace_validating_admission_policy_binding) | **PUT** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1Api* | [**replace_validating_admission_policy_status**](docs/AdmissionregistrationV1Api.md#replace_validating_admission_policy_status) | **PUT** /apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status | +*AdmissionregistrationV1Api* | [**replace_validating_webhook_configuration**](docs/AdmissionregistrationV1Api.md#replace_validating_webhook_configuration) | **PUT** /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name} | +*AdmissionregistrationV1alpha1Api* | [**create_mutating_admission_policy**](docs/AdmissionregistrationV1alpha1Api.md#create_mutating_admission_policy) | **POST** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies | +*AdmissionregistrationV1alpha1Api* | [**create_mutating_admission_policy_binding**](docs/AdmissionregistrationV1alpha1Api.md#create_mutating_admission_policy_binding) | **POST** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings | +*AdmissionregistrationV1alpha1Api* | [**delete_collection_mutating_admission_policy**](docs/AdmissionregistrationV1alpha1Api.md#delete_collection_mutating_admission_policy) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies | +*AdmissionregistrationV1alpha1Api* | [**delete_collection_mutating_admission_policy_binding**](docs/AdmissionregistrationV1alpha1Api.md#delete_collection_mutating_admission_policy_binding) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings | +*AdmissionregistrationV1alpha1Api* | [**delete_mutating_admission_policy**](docs/AdmissionregistrationV1alpha1Api.md#delete_mutating_admission_policy) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1alpha1Api* | [**delete_mutating_admission_policy_binding**](docs/AdmissionregistrationV1alpha1Api.md#delete_mutating_admission_policy_binding) | **DELETE** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1alpha1Api* | [**get_api_resources**](docs/AdmissionregistrationV1alpha1Api.md#get_api_resources) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/ | +*AdmissionregistrationV1alpha1Api* | [**list_mutating_admission_policy**](docs/AdmissionregistrationV1alpha1Api.md#list_mutating_admission_policy) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies | +*AdmissionregistrationV1alpha1Api* | [**list_mutating_admission_policy_binding**](docs/AdmissionregistrationV1alpha1Api.md#list_mutating_admission_policy_binding) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings | +*AdmissionregistrationV1alpha1Api* | [**patch_mutating_admission_policy**](docs/AdmissionregistrationV1alpha1Api.md#patch_mutating_admission_policy) | **PATCH** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1alpha1Api* | [**patch_mutating_admission_policy_binding**](docs/AdmissionregistrationV1alpha1Api.md#patch_mutating_admission_policy_binding) | **PATCH** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1alpha1Api* | [**read_mutating_admission_policy**](docs/AdmissionregistrationV1alpha1Api.md#read_mutating_admission_policy) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1alpha1Api* | [**read_mutating_admission_policy_binding**](docs/AdmissionregistrationV1alpha1Api.md#read_mutating_admission_policy_binding) | **GET** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1alpha1Api* | [**replace_mutating_admission_policy**](docs/AdmissionregistrationV1alpha1Api.md#replace_mutating_admission_policy) | **PUT** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1alpha1Api* | [**replace_mutating_admission_policy_binding**](docs/AdmissionregistrationV1alpha1Api.md#replace_mutating_admission_policy_binding) | **PUT** /apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1beta1Api* | [**create_mutating_admission_policy**](docs/AdmissionregistrationV1beta1Api.md#create_mutating_admission_policy) | **POST** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies | +*AdmissionregistrationV1beta1Api* | [**create_mutating_admission_policy_binding**](docs/AdmissionregistrationV1beta1Api.md#create_mutating_admission_policy_binding) | **POST** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings | +*AdmissionregistrationV1beta1Api* | [**delete_collection_mutating_admission_policy**](docs/AdmissionregistrationV1beta1Api.md#delete_collection_mutating_admission_policy) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies | +*AdmissionregistrationV1beta1Api* | [**delete_collection_mutating_admission_policy_binding**](docs/AdmissionregistrationV1beta1Api.md#delete_collection_mutating_admission_policy_binding) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings | +*AdmissionregistrationV1beta1Api* | [**delete_mutating_admission_policy**](docs/AdmissionregistrationV1beta1Api.md#delete_mutating_admission_policy) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1beta1Api* | [**delete_mutating_admission_policy_binding**](docs/AdmissionregistrationV1beta1Api.md#delete_mutating_admission_policy_binding) | **DELETE** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1beta1Api* | [**get_api_resources**](docs/AdmissionregistrationV1beta1Api.md#get_api_resources) | **GET** /apis/admissionregistration.k8s.io/v1beta1/ | +*AdmissionregistrationV1beta1Api* | [**list_mutating_admission_policy**](docs/AdmissionregistrationV1beta1Api.md#list_mutating_admission_policy) | **GET** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies | +*AdmissionregistrationV1beta1Api* | [**list_mutating_admission_policy_binding**](docs/AdmissionregistrationV1beta1Api.md#list_mutating_admission_policy_binding) | **GET** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings | +*AdmissionregistrationV1beta1Api* | [**patch_mutating_admission_policy**](docs/AdmissionregistrationV1beta1Api.md#patch_mutating_admission_policy) | **PATCH** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1beta1Api* | [**patch_mutating_admission_policy_binding**](docs/AdmissionregistrationV1beta1Api.md#patch_mutating_admission_policy_binding) | **PATCH** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1beta1Api* | [**read_mutating_admission_policy**](docs/AdmissionregistrationV1beta1Api.md#read_mutating_admission_policy) | **GET** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1beta1Api* | [**read_mutating_admission_policy_binding**](docs/AdmissionregistrationV1beta1Api.md#read_mutating_admission_policy_binding) | **GET** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name} | +*AdmissionregistrationV1beta1Api* | [**replace_mutating_admission_policy**](docs/AdmissionregistrationV1beta1Api.md#replace_mutating_admission_policy) | **PUT** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name} | +*AdmissionregistrationV1beta1Api* | [**replace_mutating_admission_policy_binding**](docs/AdmissionregistrationV1beta1Api.md#replace_mutating_admission_policy_binding) | **PUT** /apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name} | +*ApiextensionsApi* | [**get_api_group**](docs/ApiextensionsApi.md#get_api_group) | **GET** /apis/apiextensions.k8s.io/ | +*ApiextensionsV1Api* | [**create_custom_resource_definition**](docs/ApiextensionsV1Api.md#create_custom_resource_definition) | **POST** /apis/apiextensions.k8s.io/v1/customresourcedefinitions | +*ApiextensionsV1Api* | [**delete_collection_custom_resource_definition**](docs/ApiextensionsV1Api.md#delete_collection_custom_resource_definition) | **DELETE** /apis/apiextensions.k8s.io/v1/customresourcedefinitions | +*ApiextensionsV1Api* | [**delete_custom_resource_definition**](docs/ApiextensionsV1Api.md#delete_custom_resource_definition) | **DELETE** /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name} | +*ApiextensionsV1Api* | [**get_api_resources**](docs/ApiextensionsV1Api.md#get_api_resources) | **GET** /apis/apiextensions.k8s.io/v1/ | +*ApiextensionsV1Api* | [**list_custom_resource_definition**](docs/ApiextensionsV1Api.md#list_custom_resource_definition) | **GET** /apis/apiextensions.k8s.io/v1/customresourcedefinitions | +*ApiextensionsV1Api* | [**patch_custom_resource_definition**](docs/ApiextensionsV1Api.md#patch_custom_resource_definition) | **PATCH** /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name} | +*ApiextensionsV1Api* | [**patch_custom_resource_definition_status**](docs/ApiextensionsV1Api.md#patch_custom_resource_definition_status) | **PATCH** /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status | +*ApiextensionsV1Api* | [**read_custom_resource_definition**](docs/ApiextensionsV1Api.md#read_custom_resource_definition) | **GET** /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name} | +*ApiextensionsV1Api* | [**read_custom_resource_definition_status**](docs/ApiextensionsV1Api.md#read_custom_resource_definition_status) | **GET** /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status | +*ApiextensionsV1Api* | [**replace_custom_resource_definition**](docs/ApiextensionsV1Api.md#replace_custom_resource_definition) | **PUT** /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name} | +*ApiextensionsV1Api* | [**replace_custom_resource_definition_status**](docs/ApiextensionsV1Api.md#replace_custom_resource_definition_status) | **PUT** /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status | +*ApiregistrationApi* | [**get_api_group**](docs/ApiregistrationApi.md#get_api_group) | **GET** /apis/apiregistration.k8s.io/ | +*ApiregistrationV1Api* | [**create_api_service**](docs/ApiregistrationV1Api.md#create_api_service) | **POST** /apis/apiregistration.k8s.io/v1/apiservices | +*ApiregistrationV1Api* | [**delete_api_service**](docs/ApiregistrationV1Api.md#delete_api_service) | **DELETE** /apis/apiregistration.k8s.io/v1/apiservices/{name} | +*ApiregistrationV1Api* | [**delete_collection_api_service**](docs/ApiregistrationV1Api.md#delete_collection_api_service) | **DELETE** /apis/apiregistration.k8s.io/v1/apiservices | +*ApiregistrationV1Api* | [**get_api_resources**](docs/ApiregistrationV1Api.md#get_api_resources) | **GET** /apis/apiregistration.k8s.io/v1/ | +*ApiregistrationV1Api* | [**list_api_service**](docs/ApiregistrationV1Api.md#list_api_service) | **GET** /apis/apiregistration.k8s.io/v1/apiservices | +*ApiregistrationV1Api* | [**patch_api_service**](docs/ApiregistrationV1Api.md#patch_api_service) | **PATCH** /apis/apiregistration.k8s.io/v1/apiservices/{name} | +*ApiregistrationV1Api* | [**patch_api_service_status**](docs/ApiregistrationV1Api.md#patch_api_service_status) | **PATCH** /apis/apiregistration.k8s.io/v1/apiservices/{name}/status | +*ApiregistrationV1Api* | [**read_api_service**](docs/ApiregistrationV1Api.md#read_api_service) | **GET** /apis/apiregistration.k8s.io/v1/apiservices/{name} | +*ApiregistrationV1Api* | [**read_api_service_status**](docs/ApiregistrationV1Api.md#read_api_service_status) | **GET** /apis/apiregistration.k8s.io/v1/apiservices/{name}/status | +*ApiregistrationV1Api* | [**replace_api_service**](docs/ApiregistrationV1Api.md#replace_api_service) | **PUT** /apis/apiregistration.k8s.io/v1/apiservices/{name} | +*ApiregistrationV1Api* | [**replace_api_service_status**](docs/ApiregistrationV1Api.md#replace_api_service_status) | **PUT** /apis/apiregistration.k8s.io/v1/apiservices/{name}/status | +*ApisApi* | [**get_api_versions**](docs/ApisApi.md#get_api_versions) | **GET** /apis/ | +*AppsApi* | [**get_api_group**](docs/AppsApi.md#get_api_group) | **GET** /apis/apps/ | +*AppsV1Api* | [**create_namespaced_controller_revision**](docs/AppsV1Api.md#create_namespaced_controller_revision) | **POST** /apis/apps/v1/namespaces/{namespace}/controllerrevisions | +*AppsV1Api* | [**create_namespaced_daemon_set**](docs/AppsV1Api.md#create_namespaced_daemon_set) | **POST** /apis/apps/v1/namespaces/{namespace}/daemonsets | +*AppsV1Api* | [**create_namespaced_deployment**](docs/AppsV1Api.md#create_namespaced_deployment) | **POST** /apis/apps/v1/namespaces/{namespace}/deployments | +*AppsV1Api* | [**create_namespaced_replica_set**](docs/AppsV1Api.md#create_namespaced_replica_set) | **POST** /apis/apps/v1/namespaces/{namespace}/replicasets | +*AppsV1Api* | [**create_namespaced_stateful_set**](docs/AppsV1Api.md#create_namespaced_stateful_set) | **POST** /apis/apps/v1/namespaces/{namespace}/statefulsets | +*AppsV1Api* | [**delete_collection_namespaced_controller_revision**](docs/AppsV1Api.md#delete_collection_namespaced_controller_revision) | **DELETE** /apis/apps/v1/namespaces/{namespace}/controllerrevisions | +*AppsV1Api* | [**delete_collection_namespaced_daemon_set**](docs/AppsV1Api.md#delete_collection_namespaced_daemon_set) | **DELETE** /apis/apps/v1/namespaces/{namespace}/daemonsets | +*AppsV1Api* | [**delete_collection_namespaced_deployment**](docs/AppsV1Api.md#delete_collection_namespaced_deployment) | **DELETE** /apis/apps/v1/namespaces/{namespace}/deployments | +*AppsV1Api* | [**delete_collection_namespaced_replica_set**](docs/AppsV1Api.md#delete_collection_namespaced_replica_set) | **DELETE** /apis/apps/v1/namespaces/{namespace}/replicasets | +*AppsV1Api* | [**delete_collection_namespaced_stateful_set**](docs/AppsV1Api.md#delete_collection_namespaced_stateful_set) | **DELETE** /apis/apps/v1/namespaces/{namespace}/statefulsets | +*AppsV1Api* | [**delete_namespaced_controller_revision**](docs/AppsV1Api.md#delete_namespaced_controller_revision) | **DELETE** /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name} | +*AppsV1Api* | [**delete_namespaced_daemon_set**](docs/AppsV1Api.md#delete_namespaced_daemon_set) | **DELETE** /apis/apps/v1/namespaces/{namespace}/daemonsets/{name} | +*AppsV1Api* | [**delete_namespaced_deployment**](docs/AppsV1Api.md#delete_namespaced_deployment) | **DELETE** /apis/apps/v1/namespaces/{namespace}/deployments/{name} | +*AppsV1Api* | [**delete_namespaced_replica_set**](docs/AppsV1Api.md#delete_namespaced_replica_set) | **DELETE** /apis/apps/v1/namespaces/{namespace}/replicasets/{name} | +*AppsV1Api* | [**delete_namespaced_stateful_set**](docs/AppsV1Api.md#delete_namespaced_stateful_set) | **DELETE** /apis/apps/v1/namespaces/{namespace}/statefulsets/{name} | +*AppsV1Api* | [**get_api_resources**](docs/AppsV1Api.md#get_api_resources) | **GET** /apis/apps/v1/ | +*AppsV1Api* | [**list_controller_revision_for_all_namespaces**](docs/AppsV1Api.md#list_controller_revision_for_all_namespaces) | **GET** /apis/apps/v1/controllerrevisions | +*AppsV1Api* | [**list_daemon_set_for_all_namespaces**](docs/AppsV1Api.md#list_daemon_set_for_all_namespaces) | **GET** /apis/apps/v1/daemonsets | +*AppsV1Api* | [**list_deployment_for_all_namespaces**](docs/AppsV1Api.md#list_deployment_for_all_namespaces) | **GET** /apis/apps/v1/deployments | +*AppsV1Api* | [**list_namespaced_controller_revision**](docs/AppsV1Api.md#list_namespaced_controller_revision) | **GET** /apis/apps/v1/namespaces/{namespace}/controllerrevisions | +*AppsV1Api* | [**list_namespaced_daemon_set**](docs/AppsV1Api.md#list_namespaced_daemon_set) | **GET** /apis/apps/v1/namespaces/{namespace}/daemonsets | +*AppsV1Api* | [**list_namespaced_deployment**](docs/AppsV1Api.md#list_namespaced_deployment) | **GET** /apis/apps/v1/namespaces/{namespace}/deployments | +*AppsV1Api* | [**list_namespaced_replica_set**](docs/AppsV1Api.md#list_namespaced_replica_set) | **GET** /apis/apps/v1/namespaces/{namespace}/replicasets | +*AppsV1Api* | [**list_namespaced_stateful_set**](docs/AppsV1Api.md#list_namespaced_stateful_set) | **GET** /apis/apps/v1/namespaces/{namespace}/statefulsets | +*AppsV1Api* | [**list_replica_set_for_all_namespaces**](docs/AppsV1Api.md#list_replica_set_for_all_namespaces) | **GET** /apis/apps/v1/replicasets | +*AppsV1Api* | [**list_stateful_set_for_all_namespaces**](docs/AppsV1Api.md#list_stateful_set_for_all_namespaces) | **GET** /apis/apps/v1/statefulsets | +*AppsV1Api* | [**patch_namespaced_controller_revision**](docs/AppsV1Api.md#patch_namespaced_controller_revision) | **PATCH** /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name} | +*AppsV1Api* | [**patch_namespaced_daemon_set**](docs/AppsV1Api.md#patch_namespaced_daemon_set) | **PATCH** /apis/apps/v1/namespaces/{namespace}/daemonsets/{name} | +*AppsV1Api* | [**patch_namespaced_daemon_set_status**](docs/AppsV1Api.md#patch_namespaced_daemon_set_status) | **PATCH** /apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status | +*AppsV1Api* | [**patch_namespaced_deployment**](docs/AppsV1Api.md#patch_namespaced_deployment) | **PATCH** /apis/apps/v1/namespaces/{namespace}/deployments/{name} | +*AppsV1Api* | [**patch_namespaced_deployment_scale**](docs/AppsV1Api.md#patch_namespaced_deployment_scale) | **PATCH** /apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale | +*AppsV1Api* | [**patch_namespaced_deployment_status**](docs/AppsV1Api.md#patch_namespaced_deployment_status) | **PATCH** /apis/apps/v1/namespaces/{namespace}/deployments/{name}/status | +*AppsV1Api* | [**patch_namespaced_replica_set**](docs/AppsV1Api.md#patch_namespaced_replica_set) | **PATCH** /apis/apps/v1/namespaces/{namespace}/replicasets/{name} | +*AppsV1Api* | [**patch_namespaced_replica_set_scale**](docs/AppsV1Api.md#patch_namespaced_replica_set_scale) | **PATCH** /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale | +*AppsV1Api* | [**patch_namespaced_replica_set_status**](docs/AppsV1Api.md#patch_namespaced_replica_set_status) | **PATCH** /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status | +*AppsV1Api* | [**patch_namespaced_stateful_set**](docs/AppsV1Api.md#patch_namespaced_stateful_set) | **PATCH** /apis/apps/v1/namespaces/{namespace}/statefulsets/{name} | +*AppsV1Api* | [**patch_namespaced_stateful_set_scale**](docs/AppsV1Api.md#patch_namespaced_stateful_set_scale) | **PATCH** /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale | +*AppsV1Api* | [**patch_namespaced_stateful_set_status**](docs/AppsV1Api.md#patch_namespaced_stateful_set_status) | **PATCH** /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status | +*AppsV1Api* | [**read_namespaced_controller_revision**](docs/AppsV1Api.md#read_namespaced_controller_revision) | **GET** /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name} | +*AppsV1Api* | [**read_namespaced_daemon_set**](docs/AppsV1Api.md#read_namespaced_daemon_set) | **GET** /apis/apps/v1/namespaces/{namespace}/daemonsets/{name} | +*AppsV1Api* | [**read_namespaced_daemon_set_status**](docs/AppsV1Api.md#read_namespaced_daemon_set_status) | **GET** /apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status | +*AppsV1Api* | [**read_namespaced_deployment**](docs/AppsV1Api.md#read_namespaced_deployment) | **GET** /apis/apps/v1/namespaces/{namespace}/deployments/{name} | +*AppsV1Api* | [**read_namespaced_deployment_scale**](docs/AppsV1Api.md#read_namespaced_deployment_scale) | **GET** /apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale | +*AppsV1Api* | [**read_namespaced_deployment_status**](docs/AppsV1Api.md#read_namespaced_deployment_status) | **GET** /apis/apps/v1/namespaces/{namespace}/deployments/{name}/status | +*AppsV1Api* | [**read_namespaced_replica_set**](docs/AppsV1Api.md#read_namespaced_replica_set) | **GET** /apis/apps/v1/namespaces/{namespace}/replicasets/{name} | +*AppsV1Api* | [**read_namespaced_replica_set_scale**](docs/AppsV1Api.md#read_namespaced_replica_set_scale) | **GET** /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale | +*AppsV1Api* | [**read_namespaced_replica_set_status**](docs/AppsV1Api.md#read_namespaced_replica_set_status) | **GET** /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status | +*AppsV1Api* | [**read_namespaced_stateful_set**](docs/AppsV1Api.md#read_namespaced_stateful_set) | **GET** /apis/apps/v1/namespaces/{namespace}/statefulsets/{name} | +*AppsV1Api* | [**read_namespaced_stateful_set_scale**](docs/AppsV1Api.md#read_namespaced_stateful_set_scale) | **GET** /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale | +*AppsV1Api* | [**read_namespaced_stateful_set_status**](docs/AppsV1Api.md#read_namespaced_stateful_set_status) | **GET** /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status | +*AppsV1Api* | [**replace_namespaced_controller_revision**](docs/AppsV1Api.md#replace_namespaced_controller_revision) | **PUT** /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name} | +*AppsV1Api* | [**replace_namespaced_daemon_set**](docs/AppsV1Api.md#replace_namespaced_daemon_set) | **PUT** /apis/apps/v1/namespaces/{namespace}/daemonsets/{name} | +*AppsV1Api* | [**replace_namespaced_daemon_set_status**](docs/AppsV1Api.md#replace_namespaced_daemon_set_status) | **PUT** /apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status | +*AppsV1Api* | [**replace_namespaced_deployment**](docs/AppsV1Api.md#replace_namespaced_deployment) | **PUT** /apis/apps/v1/namespaces/{namespace}/deployments/{name} | +*AppsV1Api* | [**replace_namespaced_deployment_scale**](docs/AppsV1Api.md#replace_namespaced_deployment_scale) | **PUT** /apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale | +*AppsV1Api* | [**replace_namespaced_deployment_status**](docs/AppsV1Api.md#replace_namespaced_deployment_status) | **PUT** /apis/apps/v1/namespaces/{namespace}/deployments/{name}/status | +*AppsV1Api* | [**replace_namespaced_replica_set**](docs/AppsV1Api.md#replace_namespaced_replica_set) | **PUT** /apis/apps/v1/namespaces/{namespace}/replicasets/{name} | +*AppsV1Api* | [**replace_namespaced_replica_set_scale**](docs/AppsV1Api.md#replace_namespaced_replica_set_scale) | **PUT** /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale | +*AppsV1Api* | [**replace_namespaced_replica_set_status**](docs/AppsV1Api.md#replace_namespaced_replica_set_status) | **PUT** /apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status | +*AppsV1Api* | [**replace_namespaced_stateful_set**](docs/AppsV1Api.md#replace_namespaced_stateful_set) | **PUT** /apis/apps/v1/namespaces/{namespace}/statefulsets/{name} | +*AppsV1Api* | [**replace_namespaced_stateful_set_scale**](docs/AppsV1Api.md#replace_namespaced_stateful_set_scale) | **PUT** /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale | +*AppsV1Api* | [**replace_namespaced_stateful_set_status**](docs/AppsV1Api.md#replace_namespaced_stateful_set_status) | **PUT** /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status | +*AuthenticationApi* | [**get_api_group**](docs/AuthenticationApi.md#get_api_group) | **GET** /apis/authentication.k8s.io/ | +*AuthenticationV1Api* | [**create_self_subject_review**](docs/AuthenticationV1Api.md#create_self_subject_review) | **POST** /apis/authentication.k8s.io/v1/selfsubjectreviews | +*AuthenticationV1Api* | [**create_token_review**](docs/AuthenticationV1Api.md#create_token_review) | **POST** /apis/authentication.k8s.io/v1/tokenreviews | +*AuthenticationV1Api* | [**get_api_resources**](docs/AuthenticationV1Api.md#get_api_resources) | **GET** /apis/authentication.k8s.io/v1/ | +*AuthorizationApi* | [**get_api_group**](docs/AuthorizationApi.md#get_api_group) | **GET** /apis/authorization.k8s.io/ | +*AuthorizationV1Api* | [**create_namespaced_local_subject_access_review**](docs/AuthorizationV1Api.md#create_namespaced_local_subject_access_review) | **POST** /apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews | +*AuthorizationV1Api* | [**create_self_subject_access_review**](docs/AuthorizationV1Api.md#create_self_subject_access_review) | **POST** /apis/authorization.k8s.io/v1/selfsubjectaccessreviews | +*AuthorizationV1Api* | [**create_self_subject_rules_review**](docs/AuthorizationV1Api.md#create_self_subject_rules_review) | **POST** /apis/authorization.k8s.io/v1/selfsubjectrulesreviews | +*AuthorizationV1Api* | [**create_subject_access_review**](docs/AuthorizationV1Api.md#create_subject_access_review) | **POST** /apis/authorization.k8s.io/v1/subjectaccessreviews | +*AuthorizationV1Api* | [**get_api_resources**](docs/AuthorizationV1Api.md#get_api_resources) | **GET** /apis/authorization.k8s.io/v1/ | +*AutoscalingApi* | [**get_api_group**](docs/AutoscalingApi.md#get_api_group) | **GET** /apis/autoscaling/ | +*AutoscalingV1Api* | [**create_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV1Api.md#create_namespaced_horizontal_pod_autoscaler) | **POST** /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers | +*AutoscalingV1Api* | [**delete_collection_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV1Api.md#delete_collection_namespaced_horizontal_pod_autoscaler) | **DELETE** /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers | +*AutoscalingV1Api* | [**delete_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV1Api.md#delete_namespaced_horizontal_pod_autoscaler) | **DELETE** /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name} | +*AutoscalingV1Api* | [**get_api_resources**](docs/AutoscalingV1Api.md#get_api_resources) | **GET** /apis/autoscaling/v1/ | +*AutoscalingV1Api* | [**list_horizontal_pod_autoscaler_for_all_namespaces**](docs/AutoscalingV1Api.md#list_horizontal_pod_autoscaler_for_all_namespaces) | **GET** /apis/autoscaling/v1/horizontalpodautoscalers | +*AutoscalingV1Api* | [**list_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV1Api.md#list_namespaced_horizontal_pod_autoscaler) | **GET** /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers | +*AutoscalingV1Api* | [**patch_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV1Api.md#patch_namespaced_horizontal_pod_autoscaler) | **PATCH** /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name} | +*AutoscalingV1Api* | [**patch_namespaced_horizontal_pod_autoscaler_status**](docs/AutoscalingV1Api.md#patch_namespaced_horizontal_pod_autoscaler_status) | **PATCH** /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status | +*AutoscalingV1Api* | [**read_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV1Api.md#read_namespaced_horizontal_pod_autoscaler) | **GET** /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name} | +*AutoscalingV1Api* | [**read_namespaced_horizontal_pod_autoscaler_status**](docs/AutoscalingV1Api.md#read_namespaced_horizontal_pod_autoscaler_status) | **GET** /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status | +*AutoscalingV1Api* | [**replace_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV1Api.md#replace_namespaced_horizontal_pod_autoscaler) | **PUT** /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name} | +*AutoscalingV1Api* | [**replace_namespaced_horizontal_pod_autoscaler_status**](docs/AutoscalingV1Api.md#replace_namespaced_horizontal_pod_autoscaler_status) | **PUT** /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status | +*AutoscalingV2Api* | [**create_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV2Api.md#create_namespaced_horizontal_pod_autoscaler) | **POST** /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers | +*AutoscalingV2Api* | [**delete_collection_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV2Api.md#delete_collection_namespaced_horizontal_pod_autoscaler) | **DELETE** /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers | +*AutoscalingV2Api* | [**delete_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV2Api.md#delete_namespaced_horizontal_pod_autoscaler) | **DELETE** /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name} | +*AutoscalingV2Api* | [**get_api_resources**](docs/AutoscalingV2Api.md#get_api_resources) | **GET** /apis/autoscaling/v2/ | +*AutoscalingV2Api* | [**list_horizontal_pod_autoscaler_for_all_namespaces**](docs/AutoscalingV2Api.md#list_horizontal_pod_autoscaler_for_all_namespaces) | **GET** /apis/autoscaling/v2/horizontalpodautoscalers | +*AutoscalingV2Api* | [**list_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV2Api.md#list_namespaced_horizontal_pod_autoscaler) | **GET** /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers | +*AutoscalingV2Api* | [**patch_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV2Api.md#patch_namespaced_horizontal_pod_autoscaler) | **PATCH** /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name} | +*AutoscalingV2Api* | [**patch_namespaced_horizontal_pod_autoscaler_status**](docs/AutoscalingV2Api.md#patch_namespaced_horizontal_pod_autoscaler_status) | **PATCH** /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status | +*AutoscalingV2Api* | [**read_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV2Api.md#read_namespaced_horizontal_pod_autoscaler) | **GET** /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name} | +*AutoscalingV2Api* | [**read_namespaced_horizontal_pod_autoscaler_status**](docs/AutoscalingV2Api.md#read_namespaced_horizontal_pod_autoscaler_status) | **GET** /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status | +*AutoscalingV2Api* | [**replace_namespaced_horizontal_pod_autoscaler**](docs/AutoscalingV2Api.md#replace_namespaced_horizontal_pod_autoscaler) | **PUT** /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name} | +*AutoscalingV2Api* | [**replace_namespaced_horizontal_pod_autoscaler_status**](docs/AutoscalingV2Api.md#replace_namespaced_horizontal_pod_autoscaler_status) | **PUT** /apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status | +*BatchApi* | [**get_api_group**](docs/BatchApi.md#get_api_group) | **GET** /apis/batch/ | +*BatchV1Api* | [**create_namespaced_cron_job**](docs/BatchV1Api.md#create_namespaced_cron_job) | **POST** /apis/batch/v1/namespaces/{namespace}/cronjobs | +*BatchV1Api* | [**create_namespaced_job**](docs/BatchV1Api.md#create_namespaced_job) | **POST** /apis/batch/v1/namespaces/{namespace}/jobs | +*BatchV1Api* | [**delete_collection_namespaced_cron_job**](docs/BatchV1Api.md#delete_collection_namespaced_cron_job) | **DELETE** /apis/batch/v1/namespaces/{namespace}/cronjobs | +*BatchV1Api* | [**delete_collection_namespaced_job**](docs/BatchV1Api.md#delete_collection_namespaced_job) | **DELETE** /apis/batch/v1/namespaces/{namespace}/jobs | +*BatchV1Api* | [**delete_namespaced_cron_job**](docs/BatchV1Api.md#delete_namespaced_cron_job) | **DELETE** /apis/batch/v1/namespaces/{namespace}/cronjobs/{name} | +*BatchV1Api* | [**delete_namespaced_job**](docs/BatchV1Api.md#delete_namespaced_job) | **DELETE** /apis/batch/v1/namespaces/{namespace}/jobs/{name} | +*BatchV1Api* | [**get_api_resources**](docs/BatchV1Api.md#get_api_resources) | **GET** /apis/batch/v1/ | +*BatchV1Api* | [**list_cron_job_for_all_namespaces**](docs/BatchV1Api.md#list_cron_job_for_all_namespaces) | **GET** /apis/batch/v1/cronjobs | +*BatchV1Api* | [**list_job_for_all_namespaces**](docs/BatchV1Api.md#list_job_for_all_namespaces) | **GET** /apis/batch/v1/jobs | +*BatchV1Api* | [**list_namespaced_cron_job**](docs/BatchV1Api.md#list_namespaced_cron_job) | **GET** /apis/batch/v1/namespaces/{namespace}/cronjobs | +*BatchV1Api* | [**list_namespaced_job**](docs/BatchV1Api.md#list_namespaced_job) | **GET** /apis/batch/v1/namespaces/{namespace}/jobs | +*BatchV1Api* | [**patch_namespaced_cron_job**](docs/BatchV1Api.md#patch_namespaced_cron_job) | **PATCH** /apis/batch/v1/namespaces/{namespace}/cronjobs/{name} | +*BatchV1Api* | [**patch_namespaced_cron_job_status**](docs/BatchV1Api.md#patch_namespaced_cron_job_status) | **PATCH** /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status | +*BatchV1Api* | [**patch_namespaced_job**](docs/BatchV1Api.md#patch_namespaced_job) | **PATCH** /apis/batch/v1/namespaces/{namespace}/jobs/{name} | +*BatchV1Api* | [**patch_namespaced_job_status**](docs/BatchV1Api.md#patch_namespaced_job_status) | **PATCH** /apis/batch/v1/namespaces/{namespace}/jobs/{name}/status | +*BatchV1Api* | [**read_namespaced_cron_job**](docs/BatchV1Api.md#read_namespaced_cron_job) | **GET** /apis/batch/v1/namespaces/{namespace}/cronjobs/{name} | +*BatchV1Api* | [**read_namespaced_cron_job_status**](docs/BatchV1Api.md#read_namespaced_cron_job_status) | **GET** /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status | +*BatchV1Api* | [**read_namespaced_job**](docs/BatchV1Api.md#read_namespaced_job) | **GET** /apis/batch/v1/namespaces/{namespace}/jobs/{name} | +*BatchV1Api* | [**read_namespaced_job_status**](docs/BatchV1Api.md#read_namespaced_job_status) | **GET** /apis/batch/v1/namespaces/{namespace}/jobs/{name}/status | +*BatchV1Api* | [**replace_namespaced_cron_job**](docs/BatchV1Api.md#replace_namespaced_cron_job) | **PUT** /apis/batch/v1/namespaces/{namespace}/cronjobs/{name} | +*BatchV1Api* | [**replace_namespaced_cron_job_status**](docs/BatchV1Api.md#replace_namespaced_cron_job_status) | **PUT** /apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status | +*BatchV1Api* | [**replace_namespaced_job**](docs/BatchV1Api.md#replace_namespaced_job) | **PUT** /apis/batch/v1/namespaces/{namespace}/jobs/{name} | +*BatchV1Api* | [**replace_namespaced_job_status**](docs/BatchV1Api.md#replace_namespaced_job_status) | **PUT** /apis/batch/v1/namespaces/{namespace}/jobs/{name}/status | +*CertificatesApi* | [**get_api_group**](docs/CertificatesApi.md#get_api_group) | **GET** /apis/certificates.k8s.io/ | +*CertificatesV1Api* | [**create_certificate_signing_request**](docs/CertificatesV1Api.md#create_certificate_signing_request) | **POST** /apis/certificates.k8s.io/v1/certificatesigningrequests | +*CertificatesV1Api* | [**delete_certificate_signing_request**](docs/CertificatesV1Api.md#delete_certificate_signing_request) | **DELETE** /apis/certificates.k8s.io/v1/certificatesigningrequests/{name} | +*CertificatesV1Api* | [**delete_collection_certificate_signing_request**](docs/CertificatesV1Api.md#delete_collection_certificate_signing_request) | **DELETE** /apis/certificates.k8s.io/v1/certificatesigningrequests | +*CertificatesV1Api* | [**get_api_resources**](docs/CertificatesV1Api.md#get_api_resources) | **GET** /apis/certificates.k8s.io/v1/ | +*CertificatesV1Api* | [**list_certificate_signing_request**](docs/CertificatesV1Api.md#list_certificate_signing_request) | **GET** /apis/certificates.k8s.io/v1/certificatesigningrequests | +*CertificatesV1Api* | [**patch_certificate_signing_request**](docs/CertificatesV1Api.md#patch_certificate_signing_request) | **PATCH** /apis/certificates.k8s.io/v1/certificatesigningrequests/{name} | +*CertificatesV1Api* | [**patch_certificate_signing_request_approval**](docs/CertificatesV1Api.md#patch_certificate_signing_request_approval) | **PATCH** /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval | +*CertificatesV1Api* | [**patch_certificate_signing_request_status**](docs/CertificatesV1Api.md#patch_certificate_signing_request_status) | **PATCH** /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status | +*CertificatesV1Api* | [**read_certificate_signing_request**](docs/CertificatesV1Api.md#read_certificate_signing_request) | **GET** /apis/certificates.k8s.io/v1/certificatesigningrequests/{name} | +*CertificatesV1Api* | [**read_certificate_signing_request_approval**](docs/CertificatesV1Api.md#read_certificate_signing_request_approval) | **GET** /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval | +*CertificatesV1Api* | [**read_certificate_signing_request_status**](docs/CertificatesV1Api.md#read_certificate_signing_request_status) | **GET** /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status | +*CertificatesV1Api* | [**replace_certificate_signing_request**](docs/CertificatesV1Api.md#replace_certificate_signing_request) | **PUT** /apis/certificates.k8s.io/v1/certificatesigningrequests/{name} | +*CertificatesV1Api* | [**replace_certificate_signing_request_approval**](docs/CertificatesV1Api.md#replace_certificate_signing_request_approval) | **PUT** /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval | +*CertificatesV1Api* | [**replace_certificate_signing_request_status**](docs/CertificatesV1Api.md#replace_certificate_signing_request_status) | **PUT** /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status | +*CertificatesV1alpha1Api* | [**create_cluster_trust_bundle**](docs/CertificatesV1alpha1Api.md#create_cluster_trust_bundle) | **POST** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles | +*CertificatesV1alpha1Api* | [**delete_cluster_trust_bundle**](docs/CertificatesV1alpha1Api.md#delete_cluster_trust_bundle) | **DELETE** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | +*CertificatesV1alpha1Api* | [**delete_collection_cluster_trust_bundle**](docs/CertificatesV1alpha1Api.md#delete_collection_cluster_trust_bundle) | **DELETE** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles | +*CertificatesV1alpha1Api* | [**get_api_resources**](docs/CertificatesV1alpha1Api.md#get_api_resources) | **GET** /apis/certificates.k8s.io/v1alpha1/ | +*CertificatesV1alpha1Api* | [**list_cluster_trust_bundle**](docs/CertificatesV1alpha1Api.md#list_cluster_trust_bundle) | **GET** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles | +*CertificatesV1alpha1Api* | [**patch_cluster_trust_bundle**](docs/CertificatesV1alpha1Api.md#patch_cluster_trust_bundle) | **PATCH** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | +*CertificatesV1alpha1Api* | [**read_cluster_trust_bundle**](docs/CertificatesV1alpha1Api.md#read_cluster_trust_bundle) | **GET** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | +*CertificatesV1alpha1Api* | [**replace_cluster_trust_bundle**](docs/CertificatesV1alpha1Api.md#replace_cluster_trust_bundle) | **PUT** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | +*CertificatesV1beta1Api* | [**create_cluster_trust_bundle**](docs/CertificatesV1beta1Api.md#create_cluster_trust_bundle) | **POST** /apis/certificates.k8s.io/v1beta1/clustertrustbundles | +*CertificatesV1beta1Api* | [**create_namespaced_pod_certificate_request**](docs/CertificatesV1beta1Api.md#create_namespaced_pod_certificate_request) | **POST** /apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests | +*CertificatesV1beta1Api* | [**delete_cluster_trust_bundle**](docs/CertificatesV1beta1Api.md#delete_cluster_trust_bundle) | **DELETE** /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name} | +*CertificatesV1beta1Api* | [**delete_collection_cluster_trust_bundle**](docs/CertificatesV1beta1Api.md#delete_collection_cluster_trust_bundle) | **DELETE** /apis/certificates.k8s.io/v1beta1/clustertrustbundles | +*CertificatesV1beta1Api* | [**delete_collection_namespaced_pod_certificate_request**](docs/CertificatesV1beta1Api.md#delete_collection_namespaced_pod_certificate_request) | **DELETE** /apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests | +*CertificatesV1beta1Api* | [**delete_namespaced_pod_certificate_request**](docs/CertificatesV1beta1Api.md#delete_namespaced_pod_certificate_request) | **DELETE** /apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name} | +*CertificatesV1beta1Api* | [**get_api_resources**](docs/CertificatesV1beta1Api.md#get_api_resources) | **GET** /apis/certificates.k8s.io/v1beta1/ | +*CertificatesV1beta1Api* | [**list_cluster_trust_bundle**](docs/CertificatesV1beta1Api.md#list_cluster_trust_bundle) | **GET** /apis/certificates.k8s.io/v1beta1/clustertrustbundles | +*CertificatesV1beta1Api* | [**list_namespaced_pod_certificate_request**](docs/CertificatesV1beta1Api.md#list_namespaced_pod_certificate_request) | **GET** /apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests | +*CertificatesV1beta1Api* | [**list_pod_certificate_request_for_all_namespaces**](docs/CertificatesV1beta1Api.md#list_pod_certificate_request_for_all_namespaces) | **GET** /apis/certificates.k8s.io/v1beta1/podcertificaterequests | +*CertificatesV1beta1Api* | [**patch_cluster_trust_bundle**](docs/CertificatesV1beta1Api.md#patch_cluster_trust_bundle) | **PATCH** /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name} | +*CertificatesV1beta1Api* | [**patch_namespaced_pod_certificate_request**](docs/CertificatesV1beta1Api.md#patch_namespaced_pod_certificate_request) | **PATCH** /apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name} | +*CertificatesV1beta1Api* | [**patch_namespaced_pod_certificate_request_status**](docs/CertificatesV1beta1Api.md#patch_namespaced_pod_certificate_request_status) | **PATCH** /apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name}/status | +*CertificatesV1beta1Api* | [**read_cluster_trust_bundle**](docs/CertificatesV1beta1Api.md#read_cluster_trust_bundle) | **GET** /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name} | +*CertificatesV1beta1Api* | [**read_namespaced_pod_certificate_request**](docs/CertificatesV1beta1Api.md#read_namespaced_pod_certificate_request) | **GET** /apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name} | +*CertificatesV1beta1Api* | [**read_namespaced_pod_certificate_request_status**](docs/CertificatesV1beta1Api.md#read_namespaced_pod_certificate_request_status) | **GET** /apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name}/status | +*CertificatesV1beta1Api* | [**replace_cluster_trust_bundle**](docs/CertificatesV1beta1Api.md#replace_cluster_trust_bundle) | **PUT** /apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name} | +*CertificatesV1beta1Api* | [**replace_namespaced_pod_certificate_request**](docs/CertificatesV1beta1Api.md#replace_namespaced_pod_certificate_request) | **PUT** /apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name} | +*CertificatesV1beta1Api* | [**replace_namespaced_pod_certificate_request_status**](docs/CertificatesV1beta1Api.md#replace_namespaced_pod_certificate_request_status) | **PUT** /apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name}/status | +*CoordinationApi* | [**get_api_group**](docs/CoordinationApi.md#get_api_group) | **GET** /apis/coordination.k8s.io/ | +*CoordinationV1Api* | [**create_namespaced_lease**](docs/CoordinationV1Api.md#create_namespaced_lease) | **POST** /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases | +*CoordinationV1Api* | [**delete_collection_namespaced_lease**](docs/CoordinationV1Api.md#delete_collection_namespaced_lease) | **DELETE** /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases | +*CoordinationV1Api* | [**delete_namespaced_lease**](docs/CoordinationV1Api.md#delete_namespaced_lease) | **DELETE** /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name} | +*CoordinationV1Api* | [**get_api_resources**](docs/CoordinationV1Api.md#get_api_resources) | **GET** /apis/coordination.k8s.io/v1/ | +*CoordinationV1Api* | [**list_lease_for_all_namespaces**](docs/CoordinationV1Api.md#list_lease_for_all_namespaces) | **GET** /apis/coordination.k8s.io/v1/leases | +*CoordinationV1Api* | [**list_namespaced_lease**](docs/CoordinationV1Api.md#list_namespaced_lease) | **GET** /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases | +*CoordinationV1Api* | [**patch_namespaced_lease**](docs/CoordinationV1Api.md#patch_namespaced_lease) | **PATCH** /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name} | +*CoordinationV1Api* | [**read_namespaced_lease**](docs/CoordinationV1Api.md#read_namespaced_lease) | **GET** /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name} | +*CoordinationV1Api* | [**replace_namespaced_lease**](docs/CoordinationV1Api.md#replace_namespaced_lease) | **PUT** /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name} | +*CoordinationV1alpha2Api* | [**create_namespaced_lease_candidate**](docs/CoordinationV1alpha2Api.md#create_namespaced_lease_candidate) | **POST** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates | +*CoordinationV1alpha2Api* | [**delete_collection_namespaced_lease_candidate**](docs/CoordinationV1alpha2Api.md#delete_collection_namespaced_lease_candidate) | **DELETE** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates | +*CoordinationV1alpha2Api* | [**delete_namespaced_lease_candidate**](docs/CoordinationV1alpha2Api.md#delete_namespaced_lease_candidate) | **DELETE** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1alpha2Api* | [**get_api_resources**](docs/CoordinationV1alpha2Api.md#get_api_resources) | **GET** /apis/coordination.k8s.io/v1alpha2/ | +*CoordinationV1alpha2Api* | [**list_lease_candidate_for_all_namespaces**](docs/CoordinationV1alpha2Api.md#list_lease_candidate_for_all_namespaces) | **GET** /apis/coordination.k8s.io/v1alpha2/leasecandidates | +*CoordinationV1alpha2Api* | [**list_namespaced_lease_candidate**](docs/CoordinationV1alpha2Api.md#list_namespaced_lease_candidate) | **GET** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates | +*CoordinationV1alpha2Api* | [**patch_namespaced_lease_candidate**](docs/CoordinationV1alpha2Api.md#patch_namespaced_lease_candidate) | **PATCH** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1alpha2Api* | [**read_namespaced_lease_candidate**](docs/CoordinationV1alpha2Api.md#read_namespaced_lease_candidate) | **GET** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1alpha2Api* | [**replace_namespaced_lease_candidate**](docs/CoordinationV1alpha2Api.md#replace_namespaced_lease_candidate) | **PUT** /apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1beta1Api* | [**create_namespaced_lease_candidate**](docs/CoordinationV1beta1Api.md#create_namespaced_lease_candidate) | **POST** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates | +*CoordinationV1beta1Api* | [**delete_collection_namespaced_lease_candidate**](docs/CoordinationV1beta1Api.md#delete_collection_namespaced_lease_candidate) | **DELETE** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates | +*CoordinationV1beta1Api* | [**delete_namespaced_lease_candidate**](docs/CoordinationV1beta1Api.md#delete_namespaced_lease_candidate) | **DELETE** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1beta1Api* | [**get_api_resources**](docs/CoordinationV1beta1Api.md#get_api_resources) | **GET** /apis/coordination.k8s.io/v1beta1/ | +*CoordinationV1beta1Api* | [**list_lease_candidate_for_all_namespaces**](docs/CoordinationV1beta1Api.md#list_lease_candidate_for_all_namespaces) | **GET** /apis/coordination.k8s.io/v1beta1/leasecandidates | +*CoordinationV1beta1Api* | [**list_namespaced_lease_candidate**](docs/CoordinationV1beta1Api.md#list_namespaced_lease_candidate) | **GET** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates | +*CoordinationV1beta1Api* | [**patch_namespaced_lease_candidate**](docs/CoordinationV1beta1Api.md#patch_namespaced_lease_candidate) | **PATCH** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1beta1Api* | [**read_namespaced_lease_candidate**](docs/CoordinationV1beta1Api.md#read_namespaced_lease_candidate) | **GET** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name} | +*CoordinationV1beta1Api* | [**replace_namespaced_lease_candidate**](docs/CoordinationV1beta1Api.md#replace_namespaced_lease_candidate) | **PUT** /apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name} | +*CoreApi* | [**get_api_versions**](docs/CoreApi.md#get_api_versions) | **GET** /api/ | +*CoreV1Api* | [**connect_delete_namespaced_pod_proxy**](docs/CoreV1Api.md#connect_delete_namespaced_pod_proxy) | **DELETE** /api/v1/namespaces/{namespace}/pods/{name}/proxy | +*CoreV1Api* | [**connect_delete_namespaced_pod_proxy_with_path**](docs/CoreV1Api.md#connect_delete_namespaced_pod_proxy_with_path) | **DELETE** /api/v1/namespaces/{namespace}/pods/{name}/proxy/{path} | +*CoreV1Api* | [**connect_delete_namespaced_service_proxy**](docs/CoreV1Api.md#connect_delete_namespaced_service_proxy) | **DELETE** /api/v1/namespaces/{namespace}/services/{name}/proxy | +*CoreV1Api* | [**connect_delete_namespaced_service_proxy_with_path**](docs/CoreV1Api.md#connect_delete_namespaced_service_proxy_with_path) | **DELETE** /api/v1/namespaces/{namespace}/services/{name}/proxy/{path} | +*CoreV1Api* | [**connect_delete_node_proxy**](docs/CoreV1Api.md#connect_delete_node_proxy) | **DELETE** /api/v1/nodes/{name}/proxy | +*CoreV1Api* | [**connect_delete_node_proxy_with_path**](docs/CoreV1Api.md#connect_delete_node_proxy_with_path) | **DELETE** /api/v1/nodes/{name}/proxy/{path} | +*CoreV1Api* | [**connect_get_namespaced_pod_attach**](docs/CoreV1Api.md#connect_get_namespaced_pod_attach) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/attach | +*CoreV1Api* | [**connect_get_namespaced_pod_exec**](docs/CoreV1Api.md#connect_get_namespaced_pod_exec) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/exec | +*CoreV1Api* | [**connect_get_namespaced_pod_portforward**](docs/CoreV1Api.md#connect_get_namespaced_pod_portforward) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/portforward | +*CoreV1Api* | [**connect_get_namespaced_pod_proxy**](docs/CoreV1Api.md#connect_get_namespaced_pod_proxy) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/proxy | +*CoreV1Api* | [**connect_get_namespaced_pod_proxy_with_path**](docs/CoreV1Api.md#connect_get_namespaced_pod_proxy_with_path) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/proxy/{path} | +*CoreV1Api* | [**connect_get_namespaced_service_proxy**](docs/CoreV1Api.md#connect_get_namespaced_service_proxy) | **GET** /api/v1/namespaces/{namespace}/services/{name}/proxy | +*CoreV1Api* | [**connect_get_namespaced_service_proxy_with_path**](docs/CoreV1Api.md#connect_get_namespaced_service_proxy_with_path) | **GET** /api/v1/namespaces/{namespace}/services/{name}/proxy/{path} | +*CoreV1Api* | [**connect_get_node_proxy**](docs/CoreV1Api.md#connect_get_node_proxy) | **GET** /api/v1/nodes/{name}/proxy | +*CoreV1Api* | [**connect_get_node_proxy_with_path**](docs/CoreV1Api.md#connect_get_node_proxy_with_path) | **GET** /api/v1/nodes/{name}/proxy/{path} | +*CoreV1Api* | [**connect_head_namespaced_pod_proxy**](docs/CoreV1Api.md#connect_head_namespaced_pod_proxy) | **HEAD** /api/v1/namespaces/{namespace}/pods/{name}/proxy | +*CoreV1Api* | [**connect_head_namespaced_pod_proxy_with_path**](docs/CoreV1Api.md#connect_head_namespaced_pod_proxy_with_path) | **HEAD** /api/v1/namespaces/{namespace}/pods/{name}/proxy/{path} | +*CoreV1Api* | [**connect_head_namespaced_service_proxy**](docs/CoreV1Api.md#connect_head_namespaced_service_proxy) | **HEAD** /api/v1/namespaces/{namespace}/services/{name}/proxy | +*CoreV1Api* | [**connect_head_namespaced_service_proxy_with_path**](docs/CoreV1Api.md#connect_head_namespaced_service_proxy_with_path) | **HEAD** /api/v1/namespaces/{namespace}/services/{name}/proxy/{path} | +*CoreV1Api* | [**connect_head_node_proxy**](docs/CoreV1Api.md#connect_head_node_proxy) | **HEAD** /api/v1/nodes/{name}/proxy | +*CoreV1Api* | [**connect_head_node_proxy_with_path**](docs/CoreV1Api.md#connect_head_node_proxy_with_path) | **HEAD** /api/v1/nodes/{name}/proxy/{path} | +*CoreV1Api* | [**connect_options_namespaced_pod_proxy**](docs/CoreV1Api.md#connect_options_namespaced_pod_proxy) | **OPTIONS** /api/v1/namespaces/{namespace}/pods/{name}/proxy | +*CoreV1Api* | [**connect_options_namespaced_pod_proxy_with_path**](docs/CoreV1Api.md#connect_options_namespaced_pod_proxy_with_path) | **OPTIONS** /api/v1/namespaces/{namespace}/pods/{name}/proxy/{path} | +*CoreV1Api* | [**connect_options_namespaced_service_proxy**](docs/CoreV1Api.md#connect_options_namespaced_service_proxy) | **OPTIONS** /api/v1/namespaces/{namespace}/services/{name}/proxy | +*CoreV1Api* | [**connect_options_namespaced_service_proxy_with_path**](docs/CoreV1Api.md#connect_options_namespaced_service_proxy_with_path) | **OPTIONS** /api/v1/namespaces/{namespace}/services/{name}/proxy/{path} | +*CoreV1Api* | [**connect_options_node_proxy**](docs/CoreV1Api.md#connect_options_node_proxy) | **OPTIONS** /api/v1/nodes/{name}/proxy | +*CoreV1Api* | [**connect_options_node_proxy_with_path**](docs/CoreV1Api.md#connect_options_node_proxy_with_path) | **OPTIONS** /api/v1/nodes/{name}/proxy/{path} | +*CoreV1Api* | [**connect_patch_namespaced_pod_proxy**](docs/CoreV1Api.md#connect_patch_namespaced_pod_proxy) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name}/proxy | +*CoreV1Api* | [**connect_patch_namespaced_pod_proxy_with_path**](docs/CoreV1Api.md#connect_patch_namespaced_pod_proxy_with_path) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name}/proxy/{path} | +*CoreV1Api* | [**connect_patch_namespaced_service_proxy**](docs/CoreV1Api.md#connect_patch_namespaced_service_proxy) | **PATCH** /api/v1/namespaces/{namespace}/services/{name}/proxy | +*CoreV1Api* | [**connect_patch_namespaced_service_proxy_with_path**](docs/CoreV1Api.md#connect_patch_namespaced_service_proxy_with_path) | **PATCH** /api/v1/namespaces/{namespace}/services/{name}/proxy/{path} | +*CoreV1Api* | [**connect_patch_node_proxy**](docs/CoreV1Api.md#connect_patch_node_proxy) | **PATCH** /api/v1/nodes/{name}/proxy | +*CoreV1Api* | [**connect_patch_node_proxy_with_path**](docs/CoreV1Api.md#connect_patch_node_proxy_with_path) | **PATCH** /api/v1/nodes/{name}/proxy/{path} | +*CoreV1Api* | [**connect_post_namespaced_pod_attach**](docs/CoreV1Api.md#connect_post_namespaced_pod_attach) | **POST** /api/v1/namespaces/{namespace}/pods/{name}/attach | +*CoreV1Api* | [**connect_post_namespaced_pod_exec**](docs/CoreV1Api.md#connect_post_namespaced_pod_exec) | **POST** /api/v1/namespaces/{namespace}/pods/{name}/exec | +*CoreV1Api* | [**connect_post_namespaced_pod_portforward**](docs/CoreV1Api.md#connect_post_namespaced_pod_portforward) | **POST** /api/v1/namespaces/{namespace}/pods/{name}/portforward | +*CoreV1Api* | [**connect_post_namespaced_pod_proxy**](docs/CoreV1Api.md#connect_post_namespaced_pod_proxy) | **POST** /api/v1/namespaces/{namespace}/pods/{name}/proxy | +*CoreV1Api* | [**connect_post_namespaced_pod_proxy_with_path**](docs/CoreV1Api.md#connect_post_namespaced_pod_proxy_with_path) | **POST** /api/v1/namespaces/{namespace}/pods/{name}/proxy/{path} | +*CoreV1Api* | [**connect_post_namespaced_service_proxy**](docs/CoreV1Api.md#connect_post_namespaced_service_proxy) | **POST** /api/v1/namespaces/{namespace}/services/{name}/proxy | +*CoreV1Api* | [**connect_post_namespaced_service_proxy_with_path**](docs/CoreV1Api.md#connect_post_namespaced_service_proxy_with_path) | **POST** /api/v1/namespaces/{namespace}/services/{name}/proxy/{path} | +*CoreV1Api* | [**connect_post_node_proxy**](docs/CoreV1Api.md#connect_post_node_proxy) | **POST** /api/v1/nodes/{name}/proxy | +*CoreV1Api* | [**connect_post_node_proxy_with_path**](docs/CoreV1Api.md#connect_post_node_proxy_with_path) | **POST** /api/v1/nodes/{name}/proxy/{path} | +*CoreV1Api* | [**connect_put_namespaced_pod_proxy**](docs/CoreV1Api.md#connect_put_namespaced_pod_proxy) | **PUT** /api/v1/namespaces/{namespace}/pods/{name}/proxy | +*CoreV1Api* | [**connect_put_namespaced_pod_proxy_with_path**](docs/CoreV1Api.md#connect_put_namespaced_pod_proxy_with_path) | **PUT** /api/v1/namespaces/{namespace}/pods/{name}/proxy/{path} | +*CoreV1Api* | [**connect_put_namespaced_service_proxy**](docs/CoreV1Api.md#connect_put_namespaced_service_proxy) | **PUT** /api/v1/namespaces/{namespace}/services/{name}/proxy | +*CoreV1Api* | [**connect_put_namespaced_service_proxy_with_path**](docs/CoreV1Api.md#connect_put_namespaced_service_proxy_with_path) | **PUT** /api/v1/namespaces/{namespace}/services/{name}/proxy/{path} | +*CoreV1Api* | [**connect_put_node_proxy**](docs/CoreV1Api.md#connect_put_node_proxy) | **PUT** /api/v1/nodes/{name}/proxy | +*CoreV1Api* | [**connect_put_node_proxy_with_path**](docs/CoreV1Api.md#connect_put_node_proxy_with_path) | **PUT** /api/v1/nodes/{name}/proxy/{path} | +*CoreV1Api* | [**create_namespace**](docs/CoreV1Api.md#create_namespace) | **POST** /api/v1/namespaces | +*CoreV1Api* | [**create_namespaced_binding**](docs/CoreV1Api.md#create_namespaced_binding) | **POST** /api/v1/namespaces/{namespace}/bindings | +*CoreV1Api* | [**create_namespaced_config_map**](docs/CoreV1Api.md#create_namespaced_config_map) | **POST** /api/v1/namespaces/{namespace}/configmaps | +*CoreV1Api* | [**create_namespaced_endpoints**](docs/CoreV1Api.md#create_namespaced_endpoints) | **POST** /api/v1/namespaces/{namespace}/endpoints | +*CoreV1Api* | [**create_namespaced_event**](docs/CoreV1Api.md#create_namespaced_event) | **POST** /api/v1/namespaces/{namespace}/events | +*CoreV1Api* | [**create_namespaced_limit_range**](docs/CoreV1Api.md#create_namespaced_limit_range) | **POST** /api/v1/namespaces/{namespace}/limitranges | +*CoreV1Api* | [**create_namespaced_persistent_volume_claim**](docs/CoreV1Api.md#create_namespaced_persistent_volume_claim) | **POST** /api/v1/namespaces/{namespace}/persistentvolumeclaims | +*CoreV1Api* | [**create_namespaced_pod**](docs/CoreV1Api.md#create_namespaced_pod) | **POST** /api/v1/namespaces/{namespace}/pods | +*CoreV1Api* | [**create_namespaced_pod_binding**](docs/CoreV1Api.md#create_namespaced_pod_binding) | **POST** /api/v1/namespaces/{namespace}/pods/{name}/binding | +*CoreV1Api* | [**create_namespaced_pod_eviction**](docs/CoreV1Api.md#create_namespaced_pod_eviction) | **POST** /api/v1/namespaces/{namespace}/pods/{name}/eviction | +*CoreV1Api* | [**create_namespaced_pod_template**](docs/CoreV1Api.md#create_namespaced_pod_template) | **POST** /api/v1/namespaces/{namespace}/podtemplates | +*CoreV1Api* | [**create_namespaced_replication_controller**](docs/CoreV1Api.md#create_namespaced_replication_controller) | **POST** /api/v1/namespaces/{namespace}/replicationcontrollers | +*CoreV1Api* | [**create_namespaced_resource_quota**](docs/CoreV1Api.md#create_namespaced_resource_quota) | **POST** /api/v1/namespaces/{namespace}/resourcequotas | +*CoreV1Api* | [**create_namespaced_secret**](docs/CoreV1Api.md#create_namespaced_secret) | **POST** /api/v1/namespaces/{namespace}/secrets | +*CoreV1Api* | [**create_namespaced_service**](docs/CoreV1Api.md#create_namespaced_service) | **POST** /api/v1/namespaces/{namespace}/services | +*CoreV1Api* | [**create_namespaced_service_account**](docs/CoreV1Api.md#create_namespaced_service_account) | **POST** /api/v1/namespaces/{namespace}/serviceaccounts | +*CoreV1Api* | [**create_namespaced_service_account_token**](docs/CoreV1Api.md#create_namespaced_service_account_token) | **POST** /api/v1/namespaces/{namespace}/serviceaccounts/{name}/token | +*CoreV1Api* | [**create_node**](docs/CoreV1Api.md#create_node) | **POST** /api/v1/nodes | +*CoreV1Api* | [**create_persistent_volume**](docs/CoreV1Api.md#create_persistent_volume) | **POST** /api/v1/persistentvolumes | +*CoreV1Api* | [**delete_collection_namespaced_config_map**](docs/CoreV1Api.md#delete_collection_namespaced_config_map) | **DELETE** /api/v1/namespaces/{namespace}/configmaps | +*CoreV1Api* | [**delete_collection_namespaced_endpoints**](docs/CoreV1Api.md#delete_collection_namespaced_endpoints) | **DELETE** /api/v1/namespaces/{namespace}/endpoints | +*CoreV1Api* | [**delete_collection_namespaced_event**](docs/CoreV1Api.md#delete_collection_namespaced_event) | **DELETE** /api/v1/namespaces/{namespace}/events | +*CoreV1Api* | [**delete_collection_namespaced_limit_range**](docs/CoreV1Api.md#delete_collection_namespaced_limit_range) | **DELETE** /api/v1/namespaces/{namespace}/limitranges | +*CoreV1Api* | [**delete_collection_namespaced_persistent_volume_claim**](docs/CoreV1Api.md#delete_collection_namespaced_persistent_volume_claim) | **DELETE** /api/v1/namespaces/{namespace}/persistentvolumeclaims | +*CoreV1Api* | [**delete_collection_namespaced_pod**](docs/CoreV1Api.md#delete_collection_namespaced_pod) | **DELETE** /api/v1/namespaces/{namespace}/pods | +*CoreV1Api* | [**delete_collection_namespaced_pod_template**](docs/CoreV1Api.md#delete_collection_namespaced_pod_template) | **DELETE** /api/v1/namespaces/{namespace}/podtemplates | +*CoreV1Api* | [**delete_collection_namespaced_replication_controller**](docs/CoreV1Api.md#delete_collection_namespaced_replication_controller) | **DELETE** /api/v1/namespaces/{namespace}/replicationcontrollers | +*CoreV1Api* | [**delete_collection_namespaced_resource_quota**](docs/CoreV1Api.md#delete_collection_namespaced_resource_quota) | **DELETE** /api/v1/namespaces/{namespace}/resourcequotas | +*CoreV1Api* | [**delete_collection_namespaced_secret**](docs/CoreV1Api.md#delete_collection_namespaced_secret) | **DELETE** /api/v1/namespaces/{namespace}/secrets | +*CoreV1Api* | [**delete_collection_namespaced_service**](docs/CoreV1Api.md#delete_collection_namespaced_service) | **DELETE** /api/v1/namespaces/{namespace}/services | +*CoreV1Api* | [**delete_collection_namespaced_service_account**](docs/CoreV1Api.md#delete_collection_namespaced_service_account) | **DELETE** /api/v1/namespaces/{namespace}/serviceaccounts | +*CoreV1Api* | [**delete_collection_node**](docs/CoreV1Api.md#delete_collection_node) | **DELETE** /api/v1/nodes | +*CoreV1Api* | [**delete_collection_persistent_volume**](docs/CoreV1Api.md#delete_collection_persistent_volume) | **DELETE** /api/v1/persistentvolumes | +*CoreV1Api* | [**delete_namespace**](docs/CoreV1Api.md#delete_namespace) | **DELETE** /api/v1/namespaces/{name} | +*CoreV1Api* | [**delete_namespaced_config_map**](docs/CoreV1Api.md#delete_namespaced_config_map) | **DELETE** /api/v1/namespaces/{namespace}/configmaps/{name} | +*CoreV1Api* | [**delete_namespaced_endpoints**](docs/CoreV1Api.md#delete_namespaced_endpoints) | **DELETE** /api/v1/namespaces/{namespace}/endpoints/{name} | +*CoreV1Api* | [**delete_namespaced_event**](docs/CoreV1Api.md#delete_namespaced_event) | **DELETE** /api/v1/namespaces/{namespace}/events/{name} | +*CoreV1Api* | [**delete_namespaced_limit_range**](docs/CoreV1Api.md#delete_namespaced_limit_range) | **DELETE** /api/v1/namespaces/{namespace}/limitranges/{name} | +*CoreV1Api* | [**delete_namespaced_persistent_volume_claim**](docs/CoreV1Api.md#delete_namespaced_persistent_volume_claim) | **DELETE** /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name} | +*CoreV1Api* | [**delete_namespaced_pod**](docs/CoreV1Api.md#delete_namespaced_pod) | **DELETE** /api/v1/namespaces/{namespace}/pods/{name} | +*CoreV1Api* | [**delete_namespaced_pod_template**](docs/CoreV1Api.md#delete_namespaced_pod_template) | **DELETE** /api/v1/namespaces/{namespace}/podtemplates/{name} | +*CoreV1Api* | [**delete_namespaced_replication_controller**](docs/CoreV1Api.md#delete_namespaced_replication_controller) | **DELETE** /api/v1/namespaces/{namespace}/replicationcontrollers/{name} | +*CoreV1Api* | [**delete_namespaced_resource_quota**](docs/CoreV1Api.md#delete_namespaced_resource_quota) | **DELETE** /api/v1/namespaces/{namespace}/resourcequotas/{name} | +*CoreV1Api* | [**delete_namespaced_secret**](docs/CoreV1Api.md#delete_namespaced_secret) | **DELETE** /api/v1/namespaces/{namespace}/secrets/{name} | +*CoreV1Api* | [**delete_namespaced_service**](docs/CoreV1Api.md#delete_namespaced_service) | **DELETE** /api/v1/namespaces/{namespace}/services/{name} | +*CoreV1Api* | [**delete_namespaced_service_account**](docs/CoreV1Api.md#delete_namespaced_service_account) | **DELETE** /api/v1/namespaces/{namespace}/serviceaccounts/{name} | +*CoreV1Api* | [**delete_node**](docs/CoreV1Api.md#delete_node) | **DELETE** /api/v1/nodes/{name} | +*CoreV1Api* | [**delete_persistent_volume**](docs/CoreV1Api.md#delete_persistent_volume) | **DELETE** /api/v1/persistentvolumes/{name} | +*CoreV1Api* | [**get_api_resources**](docs/CoreV1Api.md#get_api_resources) | **GET** /api/v1/ | +*CoreV1Api* | [**list_component_status**](docs/CoreV1Api.md#list_component_status) | **GET** /api/v1/componentstatuses | +*CoreV1Api* | [**list_config_map_for_all_namespaces**](docs/CoreV1Api.md#list_config_map_for_all_namespaces) | **GET** /api/v1/configmaps | +*CoreV1Api* | [**list_endpoints_for_all_namespaces**](docs/CoreV1Api.md#list_endpoints_for_all_namespaces) | **GET** /api/v1/endpoints | +*CoreV1Api* | [**list_event_for_all_namespaces**](docs/CoreV1Api.md#list_event_for_all_namespaces) | **GET** /api/v1/events | +*CoreV1Api* | [**list_limit_range_for_all_namespaces**](docs/CoreV1Api.md#list_limit_range_for_all_namespaces) | **GET** /api/v1/limitranges | +*CoreV1Api* | [**list_namespace**](docs/CoreV1Api.md#list_namespace) | **GET** /api/v1/namespaces | +*CoreV1Api* | [**list_namespaced_config_map**](docs/CoreV1Api.md#list_namespaced_config_map) | **GET** /api/v1/namespaces/{namespace}/configmaps | +*CoreV1Api* | [**list_namespaced_endpoints**](docs/CoreV1Api.md#list_namespaced_endpoints) | **GET** /api/v1/namespaces/{namespace}/endpoints | +*CoreV1Api* | [**list_namespaced_event**](docs/CoreV1Api.md#list_namespaced_event) | **GET** /api/v1/namespaces/{namespace}/events | +*CoreV1Api* | [**list_namespaced_limit_range**](docs/CoreV1Api.md#list_namespaced_limit_range) | **GET** /api/v1/namespaces/{namespace}/limitranges | +*CoreV1Api* | [**list_namespaced_persistent_volume_claim**](docs/CoreV1Api.md#list_namespaced_persistent_volume_claim) | **GET** /api/v1/namespaces/{namespace}/persistentvolumeclaims | +*CoreV1Api* | [**list_namespaced_pod**](docs/CoreV1Api.md#list_namespaced_pod) | **GET** /api/v1/namespaces/{namespace}/pods | +*CoreV1Api* | [**list_namespaced_pod_template**](docs/CoreV1Api.md#list_namespaced_pod_template) | **GET** /api/v1/namespaces/{namespace}/podtemplates | +*CoreV1Api* | [**list_namespaced_replication_controller**](docs/CoreV1Api.md#list_namespaced_replication_controller) | **GET** /api/v1/namespaces/{namespace}/replicationcontrollers | +*CoreV1Api* | [**list_namespaced_resource_quota**](docs/CoreV1Api.md#list_namespaced_resource_quota) | **GET** /api/v1/namespaces/{namespace}/resourcequotas | +*CoreV1Api* | [**list_namespaced_secret**](docs/CoreV1Api.md#list_namespaced_secret) | **GET** /api/v1/namespaces/{namespace}/secrets | +*CoreV1Api* | [**list_namespaced_service**](docs/CoreV1Api.md#list_namespaced_service) | **GET** /api/v1/namespaces/{namespace}/services | +*CoreV1Api* | [**list_namespaced_service_account**](docs/CoreV1Api.md#list_namespaced_service_account) | **GET** /api/v1/namespaces/{namespace}/serviceaccounts | +*CoreV1Api* | [**list_node**](docs/CoreV1Api.md#list_node) | **GET** /api/v1/nodes | +*CoreV1Api* | [**list_persistent_volume**](docs/CoreV1Api.md#list_persistent_volume) | **GET** /api/v1/persistentvolumes | +*CoreV1Api* | [**list_persistent_volume_claim_for_all_namespaces**](docs/CoreV1Api.md#list_persistent_volume_claim_for_all_namespaces) | **GET** /api/v1/persistentvolumeclaims | +*CoreV1Api* | [**list_pod_for_all_namespaces**](docs/CoreV1Api.md#list_pod_for_all_namespaces) | **GET** /api/v1/pods | +*CoreV1Api* | [**list_pod_template_for_all_namespaces**](docs/CoreV1Api.md#list_pod_template_for_all_namespaces) | **GET** /api/v1/podtemplates | +*CoreV1Api* | [**list_replication_controller_for_all_namespaces**](docs/CoreV1Api.md#list_replication_controller_for_all_namespaces) | **GET** /api/v1/replicationcontrollers | +*CoreV1Api* | [**list_resource_quota_for_all_namespaces**](docs/CoreV1Api.md#list_resource_quota_for_all_namespaces) | **GET** /api/v1/resourcequotas | +*CoreV1Api* | [**list_secret_for_all_namespaces**](docs/CoreV1Api.md#list_secret_for_all_namespaces) | **GET** /api/v1/secrets | +*CoreV1Api* | [**list_service_account_for_all_namespaces**](docs/CoreV1Api.md#list_service_account_for_all_namespaces) | **GET** /api/v1/serviceaccounts | +*CoreV1Api* | [**list_service_for_all_namespaces**](docs/CoreV1Api.md#list_service_for_all_namespaces) | **GET** /api/v1/services | +*CoreV1Api* | [**patch_namespace**](docs/CoreV1Api.md#patch_namespace) | **PATCH** /api/v1/namespaces/{name} | +*CoreV1Api* | [**patch_namespace_status**](docs/CoreV1Api.md#patch_namespace_status) | **PATCH** /api/v1/namespaces/{name}/status | +*CoreV1Api* | [**patch_namespaced_config_map**](docs/CoreV1Api.md#patch_namespaced_config_map) | **PATCH** /api/v1/namespaces/{namespace}/configmaps/{name} | +*CoreV1Api* | [**patch_namespaced_endpoints**](docs/CoreV1Api.md#patch_namespaced_endpoints) | **PATCH** /api/v1/namespaces/{namespace}/endpoints/{name} | +*CoreV1Api* | [**patch_namespaced_event**](docs/CoreV1Api.md#patch_namespaced_event) | **PATCH** /api/v1/namespaces/{namespace}/events/{name} | +*CoreV1Api* | [**patch_namespaced_limit_range**](docs/CoreV1Api.md#patch_namespaced_limit_range) | **PATCH** /api/v1/namespaces/{namespace}/limitranges/{name} | +*CoreV1Api* | [**patch_namespaced_persistent_volume_claim**](docs/CoreV1Api.md#patch_namespaced_persistent_volume_claim) | **PATCH** /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name} | +*CoreV1Api* | [**patch_namespaced_persistent_volume_claim_status**](docs/CoreV1Api.md#patch_namespaced_persistent_volume_claim_status) | **PATCH** /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status | +*CoreV1Api* | [**patch_namespaced_pod**](docs/CoreV1Api.md#patch_namespaced_pod) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name} | +*CoreV1Api* | [**patch_namespaced_pod_ephemeralcontainers**](docs/CoreV1Api.md#patch_namespaced_pod_ephemeralcontainers) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers | +*CoreV1Api* | [**patch_namespaced_pod_resize**](docs/CoreV1Api.md#patch_namespaced_pod_resize) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name}/resize | +*CoreV1Api* | [**patch_namespaced_pod_status**](docs/CoreV1Api.md#patch_namespaced_pod_status) | **PATCH** /api/v1/namespaces/{namespace}/pods/{name}/status | +*CoreV1Api* | [**patch_namespaced_pod_template**](docs/CoreV1Api.md#patch_namespaced_pod_template) | **PATCH** /api/v1/namespaces/{namespace}/podtemplates/{name} | +*CoreV1Api* | [**patch_namespaced_replication_controller**](docs/CoreV1Api.md#patch_namespaced_replication_controller) | **PATCH** /api/v1/namespaces/{namespace}/replicationcontrollers/{name} | +*CoreV1Api* | [**patch_namespaced_replication_controller_scale**](docs/CoreV1Api.md#patch_namespaced_replication_controller_scale) | **PATCH** /api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale | +*CoreV1Api* | [**patch_namespaced_replication_controller_status**](docs/CoreV1Api.md#patch_namespaced_replication_controller_status) | **PATCH** /api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status | +*CoreV1Api* | [**patch_namespaced_resource_quota**](docs/CoreV1Api.md#patch_namespaced_resource_quota) | **PATCH** /api/v1/namespaces/{namespace}/resourcequotas/{name} | +*CoreV1Api* | [**patch_namespaced_resource_quota_status**](docs/CoreV1Api.md#patch_namespaced_resource_quota_status) | **PATCH** /api/v1/namespaces/{namespace}/resourcequotas/{name}/status | +*CoreV1Api* | [**patch_namespaced_secret**](docs/CoreV1Api.md#patch_namespaced_secret) | **PATCH** /api/v1/namespaces/{namespace}/secrets/{name} | +*CoreV1Api* | [**patch_namespaced_service**](docs/CoreV1Api.md#patch_namespaced_service) | **PATCH** /api/v1/namespaces/{namespace}/services/{name} | +*CoreV1Api* | [**patch_namespaced_service_account**](docs/CoreV1Api.md#patch_namespaced_service_account) | **PATCH** /api/v1/namespaces/{namespace}/serviceaccounts/{name} | +*CoreV1Api* | [**patch_namespaced_service_status**](docs/CoreV1Api.md#patch_namespaced_service_status) | **PATCH** /api/v1/namespaces/{namespace}/services/{name}/status | +*CoreV1Api* | [**patch_node**](docs/CoreV1Api.md#patch_node) | **PATCH** /api/v1/nodes/{name} | +*CoreV1Api* | [**patch_node_status**](docs/CoreV1Api.md#patch_node_status) | **PATCH** /api/v1/nodes/{name}/status | +*CoreV1Api* | [**patch_persistent_volume**](docs/CoreV1Api.md#patch_persistent_volume) | **PATCH** /api/v1/persistentvolumes/{name} | +*CoreV1Api* | [**patch_persistent_volume_status**](docs/CoreV1Api.md#patch_persistent_volume_status) | **PATCH** /api/v1/persistentvolumes/{name}/status | +*CoreV1Api* | [**read_component_status**](docs/CoreV1Api.md#read_component_status) | **GET** /api/v1/componentstatuses/{name} | +*CoreV1Api* | [**read_namespace**](docs/CoreV1Api.md#read_namespace) | **GET** /api/v1/namespaces/{name} | +*CoreV1Api* | [**read_namespace_status**](docs/CoreV1Api.md#read_namespace_status) | **GET** /api/v1/namespaces/{name}/status | +*CoreV1Api* | [**read_namespaced_config_map**](docs/CoreV1Api.md#read_namespaced_config_map) | **GET** /api/v1/namespaces/{namespace}/configmaps/{name} | +*CoreV1Api* | [**read_namespaced_endpoints**](docs/CoreV1Api.md#read_namespaced_endpoints) | **GET** /api/v1/namespaces/{namespace}/endpoints/{name} | +*CoreV1Api* | [**read_namespaced_event**](docs/CoreV1Api.md#read_namespaced_event) | **GET** /api/v1/namespaces/{namespace}/events/{name} | +*CoreV1Api* | [**read_namespaced_limit_range**](docs/CoreV1Api.md#read_namespaced_limit_range) | **GET** /api/v1/namespaces/{namespace}/limitranges/{name} | +*CoreV1Api* | [**read_namespaced_persistent_volume_claim**](docs/CoreV1Api.md#read_namespaced_persistent_volume_claim) | **GET** /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name} | +*CoreV1Api* | [**read_namespaced_persistent_volume_claim_status**](docs/CoreV1Api.md#read_namespaced_persistent_volume_claim_status) | **GET** /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status | +*CoreV1Api* | [**read_namespaced_pod**](docs/CoreV1Api.md#read_namespaced_pod) | **GET** /api/v1/namespaces/{namespace}/pods/{name} | +*CoreV1Api* | [**read_namespaced_pod_ephemeralcontainers**](docs/CoreV1Api.md#read_namespaced_pod_ephemeralcontainers) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers | +*CoreV1Api* | [**read_namespaced_pod_log**](docs/CoreV1Api.md#read_namespaced_pod_log) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/log | +*CoreV1Api* | [**read_namespaced_pod_resize**](docs/CoreV1Api.md#read_namespaced_pod_resize) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/resize | +*CoreV1Api* | [**read_namespaced_pod_status**](docs/CoreV1Api.md#read_namespaced_pod_status) | **GET** /api/v1/namespaces/{namespace}/pods/{name}/status | +*CoreV1Api* | [**read_namespaced_pod_template**](docs/CoreV1Api.md#read_namespaced_pod_template) | **GET** /api/v1/namespaces/{namespace}/podtemplates/{name} | +*CoreV1Api* | [**read_namespaced_replication_controller**](docs/CoreV1Api.md#read_namespaced_replication_controller) | **GET** /api/v1/namespaces/{namespace}/replicationcontrollers/{name} | +*CoreV1Api* | [**read_namespaced_replication_controller_scale**](docs/CoreV1Api.md#read_namespaced_replication_controller_scale) | **GET** /api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale | +*CoreV1Api* | [**read_namespaced_replication_controller_status**](docs/CoreV1Api.md#read_namespaced_replication_controller_status) | **GET** /api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status | +*CoreV1Api* | [**read_namespaced_resource_quota**](docs/CoreV1Api.md#read_namespaced_resource_quota) | **GET** /api/v1/namespaces/{namespace}/resourcequotas/{name} | +*CoreV1Api* | [**read_namespaced_resource_quota_status**](docs/CoreV1Api.md#read_namespaced_resource_quota_status) | **GET** /api/v1/namespaces/{namespace}/resourcequotas/{name}/status | +*CoreV1Api* | [**read_namespaced_secret**](docs/CoreV1Api.md#read_namespaced_secret) | **GET** /api/v1/namespaces/{namespace}/secrets/{name} | +*CoreV1Api* | [**read_namespaced_service**](docs/CoreV1Api.md#read_namespaced_service) | **GET** /api/v1/namespaces/{namespace}/services/{name} | +*CoreV1Api* | [**read_namespaced_service_account**](docs/CoreV1Api.md#read_namespaced_service_account) | **GET** /api/v1/namespaces/{namespace}/serviceaccounts/{name} | +*CoreV1Api* | [**read_namespaced_service_status**](docs/CoreV1Api.md#read_namespaced_service_status) | **GET** /api/v1/namespaces/{namespace}/services/{name}/status | +*CoreV1Api* | [**read_node**](docs/CoreV1Api.md#read_node) | **GET** /api/v1/nodes/{name} | +*CoreV1Api* | [**read_node_status**](docs/CoreV1Api.md#read_node_status) | **GET** /api/v1/nodes/{name}/status | +*CoreV1Api* | [**read_persistent_volume**](docs/CoreV1Api.md#read_persistent_volume) | **GET** /api/v1/persistentvolumes/{name} | +*CoreV1Api* | [**read_persistent_volume_status**](docs/CoreV1Api.md#read_persistent_volume_status) | **GET** /api/v1/persistentvolumes/{name}/status | +*CoreV1Api* | [**replace_namespace**](docs/CoreV1Api.md#replace_namespace) | **PUT** /api/v1/namespaces/{name} | +*CoreV1Api* | [**replace_namespace_finalize**](docs/CoreV1Api.md#replace_namespace_finalize) | **PUT** /api/v1/namespaces/{name}/finalize | +*CoreV1Api* | [**replace_namespace_status**](docs/CoreV1Api.md#replace_namespace_status) | **PUT** /api/v1/namespaces/{name}/status | +*CoreV1Api* | [**replace_namespaced_config_map**](docs/CoreV1Api.md#replace_namespaced_config_map) | **PUT** /api/v1/namespaces/{namespace}/configmaps/{name} | +*CoreV1Api* | [**replace_namespaced_endpoints**](docs/CoreV1Api.md#replace_namespaced_endpoints) | **PUT** /api/v1/namespaces/{namespace}/endpoints/{name} | +*CoreV1Api* | [**replace_namespaced_event**](docs/CoreV1Api.md#replace_namespaced_event) | **PUT** /api/v1/namespaces/{namespace}/events/{name} | +*CoreV1Api* | [**replace_namespaced_limit_range**](docs/CoreV1Api.md#replace_namespaced_limit_range) | **PUT** /api/v1/namespaces/{namespace}/limitranges/{name} | +*CoreV1Api* | [**replace_namespaced_persistent_volume_claim**](docs/CoreV1Api.md#replace_namespaced_persistent_volume_claim) | **PUT** /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name} | +*CoreV1Api* | [**replace_namespaced_persistent_volume_claim_status**](docs/CoreV1Api.md#replace_namespaced_persistent_volume_claim_status) | **PUT** /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status | +*CoreV1Api* | [**replace_namespaced_pod**](docs/CoreV1Api.md#replace_namespaced_pod) | **PUT** /api/v1/namespaces/{namespace}/pods/{name} | +*CoreV1Api* | [**replace_namespaced_pod_ephemeralcontainers**](docs/CoreV1Api.md#replace_namespaced_pod_ephemeralcontainers) | **PUT** /api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers | +*CoreV1Api* | [**replace_namespaced_pod_resize**](docs/CoreV1Api.md#replace_namespaced_pod_resize) | **PUT** /api/v1/namespaces/{namespace}/pods/{name}/resize | +*CoreV1Api* | [**replace_namespaced_pod_status**](docs/CoreV1Api.md#replace_namespaced_pod_status) | **PUT** /api/v1/namespaces/{namespace}/pods/{name}/status | +*CoreV1Api* | [**replace_namespaced_pod_template**](docs/CoreV1Api.md#replace_namespaced_pod_template) | **PUT** /api/v1/namespaces/{namespace}/podtemplates/{name} | +*CoreV1Api* | [**replace_namespaced_replication_controller**](docs/CoreV1Api.md#replace_namespaced_replication_controller) | **PUT** /api/v1/namespaces/{namespace}/replicationcontrollers/{name} | +*CoreV1Api* | [**replace_namespaced_replication_controller_scale**](docs/CoreV1Api.md#replace_namespaced_replication_controller_scale) | **PUT** /api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale | +*CoreV1Api* | [**replace_namespaced_replication_controller_status**](docs/CoreV1Api.md#replace_namespaced_replication_controller_status) | **PUT** /api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status | +*CoreV1Api* | [**replace_namespaced_resource_quota**](docs/CoreV1Api.md#replace_namespaced_resource_quota) | **PUT** /api/v1/namespaces/{namespace}/resourcequotas/{name} | +*CoreV1Api* | [**replace_namespaced_resource_quota_status**](docs/CoreV1Api.md#replace_namespaced_resource_quota_status) | **PUT** /api/v1/namespaces/{namespace}/resourcequotas/{name}/status | +*CoreV1Api* | [**replace_namespaced_secret**](docs/CoreV1Api.md#replace_namespaced_secret) | **PUT** /api/v1/namespaces/{namespace}/secrets/{name} | +*CoreV1Api* | [**replace_namespaced_service**](docs/CoreV1Api.md#replace_namespaced_service) | **PUT** /api/v1/namespaces/{namespace}/services/{name} | +*CoreV1Api* | [**replace_namespaced_service_account**](docs/CoreV1Api.md#replace_namespaced_service_account) | **PUT** /api/v1/namespaces/{namespace}/serviceaccounts/{name} | +*CoreV1Api* | [**replace_namespaced_service_status**](docs/CoreV1Api.md#replace_namespaced_service_status) | **PUT** /api/v1/namespaces/{namespace}/services/{name}/status | +*CoreV1Api* | [**replace_node**](docs/CoreV1Api.md#replace_node) | **PUT** /api/v1/nodes/{name} | +*CoreV1Api* | [**replace_node_status**](docs/CoreV1Api.md#replace_node_status) | **PUT** /api/v1/nodes/{name}/status | +*CoreV1Api* | [**replace_persistent_volume**](docs/CoreV1Api.md#replace_persistent_volume) | **PUT** /api/v1/persistentvolumes/{name} | +*CoreV1Api* | [**replace_persistent_volume_status**](docs/CoreV1Api.md#replace_persistent_volume_status) | **PUT** /api/v1/persistentvolumes/{name}/status | +*CustomObjectsApi* | [**create_cluster_custom_object**](docs/CustomObjectsApi.md#create_cluster_custom_object) | **POST** /apis/{group}/{version}/{plural} | +*CustomObjectsApi* | [**create_namespaced_custom_object**](docs/CustomObjectsApi.md#create_namespaced_custom_object) | **POST** /apis/{group}/{version}/namespaces/{namespace}/{plural} | +*CustomObjectsApi* | [**delete_cluster_custom_object**](docs/CustomObjectsApi.md#delete_cluster_custom_object) | **DELETE** /apis/{group}/{version}/{plural}/{name} | +*CustomObjectsApi* | [**delete_collection_cluster_custom_object**](docs/CustomObjectsApi.md#delete_collection_cluster_custom_object) | **DELETE** /apis/{group}/{version}/{plural} | +*CustomObjectsApi* | [**delete_collection_namespaced_custom_object**](docs/CustomObjectsApi.md#delete_collection_namespaced_custom_object) | **DELETE** /apis/{group}/{version}/namespaces/{namespace}/{plural} | +*CustomObjectsApi* | [**delete_namespaced_custom_object**](docs/CustomObjectsApi.md#delete_namespaced_custom_object) | **DELETE** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} | +*CustomObjectsApi* | [**get_api_resources**](docs/CustomObjectsApi.md#get_api_resources) | **GET** /apis/{group}/{version} | +*CustomObjectsApi* | [**get_cluster_custom_object**](docs/CustomObjectsApi.md#get_cluster_custom_object) | **GET** /apis/{group}/{version}/{plural}/{name} | +*CustomObjectsApi* | [**get_cluster_custom_object_scale**](docs/CustomObjectsApi.md#get_cluster_custom_object_scale) | **GET** /apis/{group}/{version}/{plural}/{name}/scale | +*CustomObjectsApi* | [**get_cluster_custom_object_status**](docs/CustomObjectsApi.md#get_cluster_custom_object_status) | **GET** /apis/{group}/{version}/{plural}/{name}/status | +*CustomObjectsApi* | [**get_namespaced_custom_object**](docs/CustomObjectsApi.md#get_namespaced_custom_object) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} | +*CustomObjectsApi* | [**get_namespaced_custom_object_scale**](docs/CustomObjectsApi.md#get_namespaced_custom_object_scale) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale | +*CustomObjectsApi* | [**get_namespaced_custom_object_status**](docs/CustomObjectsApi.md#get_namespaced_custom_object_status) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status | +*CustomObjectsApi* | [**list_cluster_custom_object**](docs/CustomObjectsApi.md#list_cluster_custom_object) | **GET** /apis/{group}/{version}/{plural} | +*CustomObjectsApi* | [**list_custom_object_for_all_namespaces**](docs/CustomObjectsApi.md#list_custom_object_for_all_namespaces) | **GET** /apis/{group}/{version}/{resource_plural} | +*CustomObjectsApi* | [**list_namespaced_custom_object**](docs/CustomObjectsApi.md#list_namespaced_custom_object) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural} | +*CustomObjectsApi* | [**patch_cluster_custom_object**](docs/CustomObjectsApi.md#patch_cluster_custom_object) | **PATCH** /apis/{group}/{version}/{plural}/{name} | +*CustomObjectsApi* | [**patch_cluster_custom_object_scale**](docs/CustomObjectsApi.md#patch_cluster_custom_object_scale) | **PATCH** /apis/{group}/{version}/{plural}/{name}/scale | +*CustomObjectsApi* | [**patch_cluster_custom_object_status**](docs/CustomObjectsApi.md#patch_cluster_custom_object_status) | **PATCH** /apis/{group}/{version}/{plural}/{name}/status | +*CustomObjectsApi* | [**patch_namespaced_custom_object**](docs/CustomObjectsApi.md#patch_namespaced_custom_object) | **PATCH** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} | +*CustomObjectsApi* | [**patch_namespaced_custom_object_scale**](docs/CustomObjectsApi.md#patch_namespaced_custom_object_scale) | **PATCH** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale | +*CustomObjectsApi* | [**patch_namespaced_custom_object_status**](docs/CustomObjectsApi.md#patch_namespaced_custom_object_status) | **PATCH** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status | +*CustomObjectsApi* | [**replace_cluster_custom_object**](docs/CustomObjectsApi.md#replace_cluster_custom_object) | **PUT** /apis/{group}/{version}/{plural}/{name} | +*CustomObjectsApi* | [**replace_cluster_custom_object_scale**](docs/CustomObjectsApi.md#replace_cluster_custom_object_scale) | **PUT** /apis/{group}/{version}/{plural}/{name}/scale | +*CustomObjectsApi* | [**replace_cluster_custom_object_status**](docs/CustomObjectsApi.md#replace_cluster_custom_object_status) | **PUT** /apis/{group}/{version}/{plural}/{name}/status | +*CustomObjectsApi* | [**replace_namespaced_custom_object**](docs/CustomObjectsApi.md#replace_namespaced_custom_object) | **PUT** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} | +*CustomObjectsApi* | [**replace_namespaced_custom_object_scale**](docs/CustomObjectsApi.md#replace_namespaced_custom_object_scale) | **PUT** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale | +*CustomObjectsApi* | [**replace_namespaced_custom_object_status**](docs/CustomObjectsApi.md#replace_namespaced_custom_object_status) | **PUT** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status | +*DiscoveryApi* | [**get_api_group**](docs/DiscoveryApi.md#get_api_group) | **GET** /apis/discovery.k8s.io/ | +*DiscoveryV1Api* | [**create_namespaced_endpoint_slice**](docs/DiscoveryV1Api.md#create_namespaced_endpoint_slice) | **POST** /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices | +*DiscoveryV1Api* | [**delete_collection_namespaced_endpoint_slice**](docs/DiscoveryV1Api.md#delete_collection_namespaced_endpoint_slice) | **DELETE** /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices | +*DiscoveryV1Api* | [**delete_namespaced_endpoint_slice**](docs/DiscoveryV1Api.md#delete_namespaced_endpoint_slice) | **DELETE** /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name} | +*DiscoveryV1Api* | [**get_api_resources**](docs/DiscoveryV1Api.md#get_api_resources) | **GET** /apis/discovery.k8s.io/v1/ | +*DiscoveryV1Api* | [**list_endpoint_slice_for_all_namespaces**](docs/DiscoveryV1Api.md#list_endpoint_slice_for_all_namespaces) | **GET** /apis/discovery.k8s.io/v1/endpointslices | +*DiscoveryV1Api* | [**list_namespaced_endpoint_slice**](docs/DiscoveryV1Api.md#list_namespaced_endpoint_slice) | **GET** /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices | +*DiscoveryV1Api* | [**patch_namespaced_endpoint_slice**](docs/DiscoveryV1Api.md#patch_namespaced_endpoint_slice) | **PATCH** /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name} | +*DiscoveryV1Api* | [**read_namespaced_endpoint_slice**](docs/DiscoveryV1Api.md#read_namespaced_endpoint_slice) | **GET** /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name} | +*DiscoveryV1Api* | [**replace_namespaced_endpoint_slice**](docs/DiscoveryV1Api.md#replace_namespaced_endpoint_slice) | **PUT** /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name} | +*EventsApi* | [**get_api_group**](docs/EventsApi.md#get_api_group) | **GET** /apis/events.k8s.io/ | +*EventsV1Api* | [**create_namespaced_event**](docs/EventsV1Api.md#create_namespaced_event) | **POST** /apis/events.k8s.io/v1/namespaces/{namespace}/events | +*EventsV1Api* | [**delete_collection_namespaced_event**](docs/EventsV1Api.md#delete_collection_namespaced_event) | **DELETE** /apis/events.k8s.io/v1/namespaces/{namespace}/events | +*EventsV1Api* | [**delete_namespaced_event**](docs/EventsV1Api.md#delete_namespaced_event) | **DELETE** /apis/events.k8s.io/v1/namespaces/{namespace}/events/{name} | +*EventsV1Api* | [**get_api_resources**](docs/EventsV1Api.md#get_api_resources) | **GET** /apis/events.k8s.io/v1/ | +*EventsV1Api* | [**list_event_for_all_namespaces**](docs/EventsV1Api.md#list_event_for_all_namespaces) | **GET** /apis/events.k8s.io/v1/events | +*EventsV1Api* | [**list_namespaced_event**](docs/EventsV1Api.md#list_namespaced_event) | **GET** /apis/events.k8s.io/v1/namespaces/{namespace}/events | +*EventsV1Api* | [**patch_namespaced_event**](docs/EventsV1Api.md#patch_namespaced_event) | **PATCH** /apis/events.k8s.io/v1/namespaces/{namespace}/events/{name} | +*EventsV1Api* | [**read_namespaced_event**](docs/EventsV1Api.md#read_namespaced_event) | **GET** /apis/events.k8s.io/v1/namespaces/{namespace}/events/{name} | +*EventsV1Api* | [**replace_namespaced_event**](docs/EventsV1Api.md#replace_namespaced_event) | **PUT** /apis/events.k8s.io/v1/namespaces/{namespace}/events/{name} | +*FlowcontrolApiserverApi* | [**get_api_group**](docs/FlowcontrolApiserverApi.md#get_api_group) | **GET** /apis/flowcontrol.apiserver.k8s.io/ | +*FlowcontrolApiserverV1Api* | [**create_flow_schema**](docs/FlowcontrolApiserverV1Api.md#create_flow_schema) | **POST** /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas | +*FlowcontrolApiserverV1Api* | [**create_priority_level_configuration**](docs/FlowcontrolApiserverV1Api.md#create_priority_level_configuration) | **POST** /apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations | +*FlowcontrolApiserverV1Api* | [**delete_collection_flow_schema**](docs/FlowcontrolApiserverV1Api.md#delete_collection_flow_schema) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas | +*FlowcontrolApiserverV1Api* | [**delete_collection_priority_level_configuration**](docs/FlowcontrolApiserverV1Api.md#delete_collection_priority_level_configuration) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations | +*FlowcontrolApiserverV1Api* | [**delete_flow_schema**](docs/FlowcontrolApiserverV1Api.md#delete_flow_schema) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name} | +*FlowcontrolApiserverV1Api* | [**delete_priority_level_configuration**](docs/FlowcontrolApiserverV1Api.md#delete_priority_level_configuration) | **DELETE** /apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name} | +*FlowcontrolApiserverV1Api* | [**get_api_resources**](docs/FlowcontrolApiserverV1Api.md#get_api_resources) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1/ | +*FlowcontrolApiserverV1Api* | [**list_flow_schema**](docs/FlowcontrolApiserverV1Api.md#list_flow_schema) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas | +*FlowcontrolApiserverV1Api* | [**list_priority_level_configuration**](docs/FlowcontrolApiserverV1Api.md#list_priority_level_configuration) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations | +*FlowcontrolApiserverV1Api* | [**patch_flow_schema**](docs/FlowcontrolApiserverV1Api.md#patch_flow_schema) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name} | +*FlowcontrolApiserverV1Api* | [**patch_flow_schema_status**](docs/FlowcontrolApiserverV1Api.md#patch_flow_schema_status) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status | +*FlowcontrolApiserverV1Api* | [**patch_priority_level_configuration**](docs/FlowcontrolApiserverV1Api.md#patch_priority_level_configuration) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name} | +*FlowcontrolApiserverV1Api* | [**patch_priority_level_configuration_status**](docs/FlowcontrolApiserverV1Api.md#patch_priority_level_configuration_status) | **PATCH** /apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status | +*FlowcontrolApiserverV1Api* | [**read_flow_schema**](docs/FlowcontrolApiserverV1Api.md#read_flow_schema) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name} | +*FlowcontrolApiserverV1Api* | [**read_flow_schema_status**](docs/FlowcontrolApiserverV1Api.md#read_flow_schema_status) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status | +*FlowcontrolApiserverV1Api* | [**read_priority_level_configuration**](docs/FlowcontrolApiserverV1Api.md#read_priority_level_configuration) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name} | +*FlowcontrolApiserverV1Api* | [**read_priority_level_configuration_status**](docs/FlowcontrolApiserverV1Api.md#read_priority_level_configuration_status) | **GET** /apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status | +*FlowcontrolApiserverV1Api* | [**replace_flow_schema**](docs/FlowcontrolApiserverV1Api.md#replace_flow_schema) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name} | +*FlowcontrolApiserverV1Api* | [**replace_flow_schema_status**](docs/FlowcontrolApiserverV1Api.md#replace_flow_schema_status) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status | +*FlowcontrolApiserverV1Api* | [**replace_priority_level_configuration**](docs/FlowcontrolApiserverV1Api.md#replace_priority_level_configuration) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name} | +*FlowcontrolApiserverV1Api* | [**replace_priority_level_configuration_status**](docs/FlowcontrolApiserverV1Api.md#replace_priority_level_configuration_status) | **PUT** /apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status | +*InternalApiserverApi* | [**get_api_group**](docs/InternalApiserverApi.md#get_api_group) | **GET** /apis/internal.apiserver.k8s.io/ | +*InternalApiserverV1alpha1Api* | [**create_storage_version**](docs/InternalApiserverV1alpha1Api.md#create_storage_version) | **POST** /apis/internal.apiserver.k8s.io/v1alpha1/storageversions | +*InternalApiserverV1alpha1Api* | [**delete_collection_storage_version**](docs/InternalApiserverV1alpha1Api.md#delete_collection_storage_version) | **DELETE** /apis/internal.apiserver.k8s.io/v1alpha1/storageversions | +*InternalApiserverV1alpha1Api* | [**delete_storage_version**](docs/InternalApiserverV1alpha1Api.md#delete_storage_version) | **DELETE** /apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name} | +*InternalApiserverV1alpha1Api* | [**get_api_resources**](docs/InternalApiserverV1alpha1Api.md#get_api_resources) | **GET** /apis/internal.apiserver.k8s.io/v1alpha1/ | +*InternalApiserverV1alpha1Api* | [**list_storage_version**](docs/InternalApiserverV1alpha1Api.md#list_storage_version) | **GET** /apis/internal.apiserver.k8s.io/v1alpha1/storageversions | +*InternalApiserverV1alpha1Api* | [**patch_storage_version**](docs/InternalApiserverV1alpha1Api.md#patch_storage_version) | **PATCH** /apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name} | +*InternalApiserverV1alpha1Api* | [**patch_storage_version_status**](docs/InternalApiserverV1alpha1Api.md#patch_storage_version_status) | **PATCH** /apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status | +*InternalApiserverV1alpha1Api* | [**read_storage_version**](docs/InternalApiserverV1alpha1Api.md#read_storage_version) | **GET** /apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name} | +*InternalApiserverV1alpha1Api* | [**read_storage_version_status**](docs/InternalApiserverV1alpha1Api.md#read_storage_version_status) | **GET** /apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status | +*InternalApiserverV1alpha1Api* | [**replace_storage_version**](docs/InternalApiserverV1alpha1Api.md#replace_storage_version) | **PUT** /apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name} | +*InternalApiserverV1alpha1Api* | [**replace_storage_version_status**](docs/InternalApiserverV1alpha1Api.md#replace_storage_version_status) | **PUT** /apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status | +*LogsApi* | [**log_file_handler**](docs/LogsApi.md#log_file_handler) | **GET** /logs/{logpath} | +*LogsApi* | [**log_file_list_handler**](docs/LogsApi.md#log_file_list_handler) | **GET** /logs/ | +*NetworkingApi* | [**get_api_group**](docs/NetworkingApi.md#get_api_group) | **GET** /apis/networking.k8s.io/ | +*NetworkingV1Api* | [**create_ingress_class**](docs/NetworkingV1Api.md#create_ingress_class) | **POST** /apis/networking.k8s.io/v1/ingressclasses | +*NetworkingV1Api* | [**create_ip_address**](docs/NetworkingV1Api.md#create_ip_address) | **POST** /apis/networking.k8s.io/v1/ipaddresses | +*NetworkingV1Api* | [**create_namespaced_ingress**](docs/NetworkingV1Api.md#create_namespaced_ingress) | **POST** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses | +*NetworkingV1Api* | [**create_namespaced_network_policy**](docs/NetworkingV1Api.md#create_namespaced_network_policy) | **POST** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies | +*NetworkingV1Api* | [**create_service_cidr**](docs/NetworkingV1Api.md#create_service_cidr) | **POST** /apis/networking.k8s.io/v1/servicecidrs | +*NetworkingV1Api* | [**delete_collection_ingress_class**](docs/NetworkingV1Api.md#delete_collection_ingress_class) | **DELETE** /apis/networking.k8s.io/v1/ingressclasses | +*NetworkingV1Api* | [**delete_collection_ip_address**](docs/NetworkingV1Api.md#delete_collection_ip_address) | **DELETE** /apis/networking.k8s.io/v1/ipaddresses | +*NetworkingV1Api* | [**delete_collection_namespaced_ingress**](docs/NetworkingV1Api.md#delete_collection_namespaced_ingress) | **DELETE** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses | +*NetworkingV1Api* | [**delete_collection_namespaced_network_policy**](docs/NetworkingV1Api.md#delete_collection_namespaced_network_policy) | **DELETE** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies | +*NetworkingV1Api* | [**delete_collection_service_cidr**](docs/NetworkingV1Api.md#delete_collection_service_cidr) | **DELETE** /apis/networking.k8s.io/v1/servicecidrs | +*NetworkingV1Api* | [**delete_ingress_class**](docs/NetworkingV1Api.md#delete_ingress_class) | **DELETE** /apis/networking.k8s.io/v1/ingressclasses/{name} | +*NetworkingV1Api* | [**delete_ip_address**](docs/NetworkingV1Api.md#delete_ip_address) | **DELETE** /apis/networking.k8s.io/v1/ipaddresses/{name} | +*NetworkingV1Api* | [**delete_namespaced_ingress**](docs/NetworkingV1Api.md#delete_namespaced_ingress) | **DELETE** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name} | +*NetworkingV1Api* | [**delete_namespaced_network_policy**](docs/NetworkingV1Api.md#delete_namespaced_network_policy) | **DELETE** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name} | +*NetworkingV1Api* | [**delete_service_cidr**](docs/NetworkingV1Api.md#delete_service_cidr) | **DELETE** /apis/networking.k8s.io/v1/servicecidrs/{name} | +*NetworkingV1Api* | [**get_api_resources**](docs/NetworkingV1Api.md#get_api_resources) | **GET** /apis/networking.k8s.io/v1/ | +*NetworkingV1Api* | [**list_ingress_class**](docs/NetworkingV1Api.md#list_ingress_class) | **GET** /apis/networking.k8s.io/v1/ingressclasses | +*NetworkingV1Api* | [**list_ingress_for_all_namespaces**](docs/NetworkingV1Api.md#list_ingress_for_all_namespaces) | **GET** /apis/networking.k8s.io/v1/ingresses | +*NetworkingV1Api* | [**list_ip_address**](docs/NetworkingV1Api.md#list_ip_address) | **GET** /apis/networking.k8s.io/v1/ipaddresses | +*NetworkingV1Api* | [**list_namespaced_ingress**](docs/NetworkingV1Api.md#list_namespaced_ingress) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses | +*NetworkingV1Api* | [**list_namespaced_network_policy**](docs/NetworkingV1Api.md#list_namespaced_network_policy) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies | +*NetworkingV1Api* | [**list_network_policy_for_all_namespaces**](docs/NetworkingV1Api.md#list_network_policy_for_all_namespaces) | **GET** /apis/networking.k8s.io/v1/networkpolicies | +*NetworkingV1Api* | [**list_service_cidr**](docs/NetworkingV1Api.md#list_service_cidr) | **GET** /apis/networking.k8s.io/v1/servicecidrs | +*NetworkingV1Api* | [**patch_ingress_class**](docs/NetworkingV1Api.md#patch_ingress_class) | **PATCH** /apis/networking.k8s.io/v1/ingressclasses/{name} | +*NetworkingV1Api* | [**patch_ip_address**](docs/NetworkingV1Api.md#patch_ip_address) | **PATCH** /apis/networking.k8s.io/v1/ipaddresses/{name} | +*NetworkingV1Api* | [**patch_namespaced_ingress**](docs/NetworkingV1Api.md#patch_namespaced_ingress) | **PATCH** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name} | +*NetworkingV1Api* | [**patch_namespaced_ingress_status**](docs/NetworkingV1Api.md#patch_namespaced_ingress_status) | **PATCH** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status | +*NetworkingV1Api* | [**patch_namespaced_network_policy**](docs/NetworkingV1Api.md#patch_namespaced_network_policy) | **PATCH** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name} | +*NetworkingV1Api* | [**patch_service_cidr**](docs/NetworkingV1Api.md#patch_service_cidr) | **PATCH** /apis/networking.k8s.io/v1/servicecidrs/{name} | +*NetworkingV1Api* | [**patch_service_cidr_status**](docs/NetworkingV1Api.md#patch_service_cidr_status) | **PATCH** /apis/networking.k8s.io/v1/servicecidrs/{name}/status | +*NetworkingV1Api* | [**read_ingress_class**](docs/NetworkingV1Api.md#read_ingress_class) | **GET** /apis/networking.k8s.io/v1/ingressclasses/{name} | +*NetworkingV1Api* | [**read_ip_address**](docs/NetworkingV1Api.md#read_ip_address) | **GET** /apis/networking.k8s.io/v1/ipaddresses/{name} | +*NetworkingV1Api* | [**read_namespaced_ingress**](docs/NetworkingV1Api.md#read_namespaced_ingress) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name} | +*NetworkingV1Api* | [**read_namespaced_ingress_status**](docs/NetworkingV1Api.md#read_namespaced_ingress_status) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status | +*NetworkingV1Api* | [**read_namespaced_network_policy**](docs/NetworkingV1Api.md#read_namespaced_network_policy) | **GET** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name} | +*NetworkingV1Api* | [**read_service_cidr**](docs/NetworkingV1Api.md#read_service_cidr) | **GET** /apis/networking.k8s.io/v1/servicecidrs/{name} | +*NetworkingV1Api* | [**read_service_cidr_status**](docs/NetworkingV1Api.md#read_service_cidr_status) | **GET** /apis/networking.k8s.io/v1/servicecidrs/{name}/status | +*NetworkingV1Api* | [**replace_ingress_class**](docs/NetworkingV1Api.md#replace_ingress_class) | **PUT** /apis/networking.k8s.io/v1/ingressclasses/{name} | +*NetworkingV1Api* | [**replace_ip_address**](docs/NetworkingV1Api.md#replace_ip_address) | **PUT** /apis/networking.k8s.io/v1/ipaddresses/{name} | +*NetworkingV1Api* | [**replace_namespaced_ingress**](docs/NetworkingV1Api.md#replace_namespaced_ingress) | **PUT** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name} | +*NetworkingV1Api* | [**replace_namespaced_ingress_status**](docs/NetworkingV1Api.md#replace_namespaced_ingress_status) | **PUT** /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status | +*NetworkingV1Api* | [**replace_namespaced_network_policy**](docs/NetworkingV1Api.md#replace_namespaced_network_policy) | **PUT** /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name} | +*NetworkingV1Api* | [**replace_service_cidr**](docs/NetworkingV1Api.md#replace_service_cidr) | **PUT** /apis/networking.k8s.io/v1/servicecidrs/{name} | +*NetworkingV1Api* | [**replace_service_cidr_status**](docs/NetworkingV1Api.md#replace_service_cidr_status) | **PUT** /apis/networking.k8s.io/v1/servicecidrs/{name}/status | +*NetworkingV1beta1Api* | [**create_ip_address**](docs/NetworkingV1beta1Api.md#create_ip_address) | **POST** /apis/networking.k8s.io/v1beta1/ipaddresses | +*NetworkingV1beta1Api* | [**create_service_cidr**](docs/NetworkingV1beta1Api.md#create_service_cidr) | **POST** /apis/networking.k8s.io/v1beta1/servicecidrs | +*NetworkingV1beta1Api* | [**delete_collection_ip_address**](docs/NetworkingV1beta1Api.md#delete_collection_ip_address) | **DELETE** /apis/networking.k8s.io/v1beta1/ipaddresses | +*NetworkingV1beta1Api* | [**delete_collection_service_cidr**](docs/NetworkingV1beta1Api.md#delete_collection_service_cidr) | **DELETE** /apis/networking.k8s.io/v1beta1/servicecidrs | +*NetworkingV1beta1Api* | [**delete_ip_address**](docs/NetworkingV1beta1Api.md#delete_ip_address) | **DELETE** /apis/networking.k8s.io/v1beta1/ipaddresses/{name} | +*NetworkingV1beta1Api* | [**delete_service_cidr**](docs/NetworkingV1beta1Api.md#delete_service_cidr) | **DELETE** /apis/networking.k8s.io/v1beta1/servicecidrs/{name} | +*NetworkingV1beta1Api* | [**get_api_resources**](docs/NetworkingV1beta1Api.md#get_api_resources) | **GET** /apis/networking.k8s.io/v1beta1/ | +*NetworkingV1beta1Api* | [**list_ip_address**](docs/NetworkingV1beta1Api.md#list_ip_address) | **GET** /apis/networking.k8s.io/v1beta1/ipaddresses | +*NetworkingV1beta1Api* | [**list_service_cidr**](docs/NetworkingV1beta1Api.md#list_service_cidr) | **GET** /apis/networking.k8s.io/v1beta1/servicecidrs | +*NetworkingV1beta1Api* | [**patch_ip_address**](docs/NetworkingV1beta1Api.md#patch_ip_address) | **PATCH** /apis/networking.k8s.io/v1beta1/ipaddresses/{name} | +*NetworkingV1beta1Api* | [**patch_service_cidr**](docs/NetworkingV1beta1Api.md#patch_service_cidr) | **PATCH** /apis/networking.k8s.io/v1beta1/servicecidrs/{name} | +*NetworkingV1beta1Api* | [**patch_service_cidr_status**](docs/NetworkingV1beta1Api.md#patch_service_cidr_status) | **PATCH** /apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status | +*NetworkingV1beta1Api* | [**read_ip_address**](docs/NetworkingV1beta1Api.md#read_ip_address) | **GET** /apis/networking.k8s.io/v1beta1/ipaddresses/{name} | +*NetworkingV1beta1Api* | [**read_service_cidr**](docs/NetworkingV1beta1Api.md#read_service_cidr) | **GET** /apis/networking.k8s.io/v1beta1/servicecidrs/{name} | +*NetworkingV1beta1Api* | [**read_service_cidr_status**](docs/NetworkingV1beta1Api.md#read_service_cidr_status) | **GET** /apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status | +*NetworkingV1beta1Api* | [**replace_ip_address**](docs/NetworkingV1beta1Api.md#replace_ip_address) | **PUT** /apis/networking.k8s.io/v1beta1/ipaddresses/{name} | +*NetworkingV1beta1Api* | [**replace_service_cidr**](docs/NetworkingV1beta1Api.md#replace_service_cidr) | **PUT** /apis/networking.k8s.io/v1beta1/servicecidrs/{name} | +*NetworkingV1beta1Api* | [**replace_service_cidr_status**](docs/NetworkingV1beta1Api.md#replace_service_cidr_status) | **PUT** /apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status | +*NodeApi* | [**get_api_group**](docs/NodeApi.md#get_api_group) | **GET** /apis/node.k8s.io/ | +*NodeV1Api* | [**create_runtime_class**](docs/NodeV1Api.md#create_runtime_class) | **POST** /apis/node.k8s.io/v1/runtimeclasses | +*NodeV1Api* | [**delete_collection_runtime_class**](docs/NodeV1Api.md#delete_collection_runtime_class) | **DELETE** /apis/node.k8s.io/v1/runtimeclasses | +*NodeV1Api* | [**delete_runtime_class**](docs/NodeV1Api.md#delete_runtime_class) | **DELETE** /apis/node.k8s.io/v1/runtimeclasses/{name} | +*NodeV1Api* | [**get_api_resources**](docs/NodeV1Api.md#get_api_resources) | **GET** /apis/node.k8s.io/v1/ | +*NodeV1Api* | [**list_runtime_class**](docs/NodeV1Api.md#list_runtime_class) | **GET** /apis/node.k8s.io/v1/runtimeclasses | +*NodeV1Api* | [**patch_runtime_class**](docs/NodeV1Api.md#patch_runtime_class) | **PATCH** /apis/node.k8s.io/v1/runtimeclasses/{name} | +*NodeV1Api* | [**read_runtime_class**](docs/NodeV1Api.md#read_runtime_class) | **GET** /apis/node.k8s.io/v1/runtimeclasses/{name} | +*NodeV1Api* | [**replace_runtime_class**](docs/NodeV1Api.md#replace_runtime_class) | **PUT** /apis/node.k8s.io/v1/runtimeclasses/{name} | +*OpenidApi* | [**get_service_account_issuer_open_id_keyset**](docs/OpenidApi.md#get_service_account_issuer_open_id_keyset) | **GET** /openid/v1/jwks | +*PolicyApi* | [**get_api_group**](docs/PolicyApi.md#get_api_group) | **GET** /apis/policy/ | +*PolicyV1Api* | [**create_namespaced_pod_disruption_budget**](docs/PolicyV1Api.md#create_namespaced_pod_disruption_budget) | **POST** /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets | +*PolicyV1Api* | [**delete_collection_namespaced_pod_disruption_budget**](docs/PolicyV1Api.md#delete_collection_namespaced_pod_disruption_budget) | **DELETE** /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets | +*PolicyV1Api* | [**delete_namespaced_pod_disruption_budget**](docs/PolicyV1Api.md#delete_namespaced_pod_disruption_budget) | **DELETE** /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name} | +*PolicyV1Api* | [**get_api_resources**](docs/PolicyV1Api.md#get_api_resources) | **GET** /apis/policy/v1/ | +*PolicyV1Api* | [**list_namespaced_pod_disruption_budget**](docs/PolicyV1Api.md#list_namespaced_pod_disruption_budget) | **GET** /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets | +*PolicyV1Api* | [**list_pod_disruption_budget_for_all_namespaces**](docs/PolicyV1Api.md#list_pod_disruption_budget_for_all_namespaces) | **GET** /apis/policy/v1/poddisruptionbudgets | +*PolicyV1Api* | [**patch_namespaced_pod_disruption_budget**](docs/PolicyV1Api.md#patch_namespaced_pod_disruption_budget) | **PATCH** /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name} | +*PolicyV1Api* | [**patch_namespaced_pod_disruption_budget_status**](docs/PolicyV1Api.md#patch_namespaced_pod_disruption_budget_status) | **PATCH** /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status | +*PolicyV1Api* | [**read_namespaced_pod_disruption_budget**](docs/PolicyV1Api.md#read_namespaced_pod_disruption_budget) | **GET** /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name} | +*PolicyV1Api* | [**read_namespaced_pod_disruption_budget_status**](docs/PolicyV1Api.md#read_namespaced_pod_disruption_budget_status) | **GET** /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status | +*PolicyV1Api* | [**replace_namespaced_pod_disruption_budget**](docs/PolicyV1Api.md#replace_namespaced_pod_disruption_budget) | **PUT** /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name} | +*PolicyV1Api* | [**replace_namespaced_pod_disruption_budget_status**](docs/PolicyV1Api.md#replace_namespaced_pod_disruption_budget_status) | **PUT** /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status | +*RbacAuthorizationApi* | [**get_api_group**](docs/RbacAuthorizationApi.md#get_api_group) | **GET** /apis/rbac.authorization.k8s.io/ | +*RbacAuthorizationV1Api* | [**create_cluster_role**](docs/RbacAuthorizationV1Api.md#create_cluster_role) | **POST** /apis/rbac.authorization.k8s.io/v1/clusterroles | +*RbacAuthorizationV1Api* | [**create_cluster_role_binding**](docs/RbacAuthorizationV1Api.md#create_cluster_role_binding) | **POST** /apis/rbac.authorization.k8s.io/v1/clusterrolebindings | +*RbacAuthorizationV1Api* | [**create_namespaced_role**](docs/RbacAuthorizationV1Api.md#create_namespaced_role) | **POST** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles | +*RbacAuthorizationV1Api* | [**create_namespaced_role_binding**](docs/RbacAuthorizationV1Api.md#create_namespaced_role_binding) | **POST** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings | +*RbacAuthorizationV1Api* | [**delete_cluster_role**](docs/RbacAuthorizationV1Api.md#delete_cluster_role) | **DELETE** /apis/rbac.authorization.k8s.io/v1/clusterroles/{name} | +*RbacAuthorizationV1Api* | [**delete_cluster_role_binding**](docs/RbacAuthorizationV1Api.md#delete_cluster_role_binding) | **DELETE** /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name} | +*RbacAuthorizationV1Api* | [**delete_collection_cluster_role**](docs/RbacAuthorizationV1Api.md#delete_collection_cluster_role) | **DELETE** /apis/rbac.authorization.k8s.io/v1/clusterroles | +*RbacAuthorizationV1Api* | [**delete_collection_cluster_role_binding**](docs/RbacAuthorizationV1Api.md#delete_collection_cluster_role_binding) | **DELETE** /apis/rbac.authorization.k8s.io/v1/clusterrolebindings | +*RbacAuthorizationV1Api* | [**delete_collection_namespaced_role**](docs/RbacAuthorizationV1Api.md#delete_collection_namespaced_role) | **DELETE** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles | +*RbacAuthorizationV1Api* | [**delete_collection_namespaced_role_binding**](docs/RbacAuthorizationV1Api.md#delete_collection_namespaced_role_binding) | **DELETE** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings | +*RbacAuthorizationV1Api* | [**delete_namespaced_role**](docs/RbacAuthorizationV1Api.md#delete_namespaced_role) | **DELETE** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name} | +*RbacAuthorizationV1Api* | [**delete_namespaced_role_binding**](docs/RbacAuthorizationV1Api.md#delete_namespaced_role_binding) | **DELETE** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name} | +*RbacAuthorizationV1Api* | [**get_api_resources**](docs/RbacAuthorizationV1Api.md#get_api_resources) | **GET** /apis/rbac.authorization.k8s.io/v1/ | +*RbacAuthorizationV1Api* | [**list_cluster_role**](docs/RbacAuthorizationV1Api.md#list_cluster_role) | **GET** /apis/rbac.authorization.k8s.io/v1/clusterroles | +*RbacAuthorizationV1Api* | [**list_cluster_role_binding**](docs/RbacAuthorizationV1Api.md#list_cluster_role_binding) | **GET** /apis/rbac.authorization.k8s.io/v1/clusterrolebindings | +*RbacAuthorizationV1Api* | [**list_namespaced_role**](docs/RbacAuthorizationV1Api.md#list_namespaced_role) | **GET** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles | +*RbacAuthorizationV1Api* | [**list_namespaced_role_binding**](docs/RbacAuthorizationV1Api.md#list_namespaced_role_binding) | **GET** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings | +*RbacAuthorizationV1Api* | [**list_role_binding_for_all_namespaces**](docs/RbacAuthorizationV1Api.md#list_role_binding_for_all_namespaces) | **GET** /apis/rbac.authorization.k8s.io/v1/rolebindings | +*RbacAuthorizationV1Api* | [**list_role_for_all_namespaces**](docs/RbacAuthorizationV1Api.md#list_role_for_all_namespaces) | **GET** /apis/rbac.authorization.k8s.io/v1/roles | +*RbacAuthorizationV1Api* | [**patch_cluster_role**](docs/RbacAuthorizationV1Api.md#patch_cluster_role) | **PATCH** /apis/rbac.authorization.k8s.io/v1/clusterroles/{name} | +*RbacAuthorizationV1Api* | [**patch_cluster_role_binding**](docs/RbacAuthorizationV1Api.md#patch_cluster_role_binding) | **PATCH** /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name} | +*RbacAuthorizationV1Api* | [**patch_namespaced_role**](docs/RbacAuthorizationV1Api.md#patch_namespaced_role) | **PATCH** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name} | +*RbacAuthorizationV1Api* | [**patch_namespaced_role_binding**](docs/RbacAuthorizationV1Api.md#patch_namespaced_role_binding) | **PATCH** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name} | +*RbacAuthorizationV1Api* | [**read_cluster_role**](docs/RbacAuthorizationV1Api.md#read_cluster_role) | **GET** /apis/rbac.authorization.k8s.io/v1/clusterroles/{name} | +*RbacAuthorizationV1Api* | [**read_cluster_role_binding**](docs/RbacAuthorizationV1Api.md#read_cluster_role_binding) | **GET** /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name} | +*RbacAuthorizationV1Api* | [**read_namespaced_role**](docs/RbacAuthorizationV1Api.md#read_namespaced_role) | **GET** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name} | +*RbacAuthorizationV1Api* | [**read_namespaced_role_binding**](docs/RbacAuthorizationV1Api.md#read_namespaced_role_binding) | **GET** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name} | +*RbacAuthorizationV1Api* | [**replace_cluster_role**](docs/RbacAuthorizationV1Api.md#replace_cluster_role) | **PUT** /apis/rbac.authorization.k8s.io/v1/clusterroles/{name} | +*RbacAuthorizationV1Api* | [**replace_cluster_role_binding**](docs/RbacAuthorizationV1Api.md#replace_cluster_role_binding) | **PUT** /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name} | +*RbacAuthorizationV1Api* | [**replace_namespaced_role**](docs/RbacAuthorizationV1Api.md#replace_namespaced_role) | **PUT** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name} | +*RbacAuthorizationV1Api* | [**replace_namespaced_role_binding**](docs/RbacAuthorizationV1Api.md#replace_namespaced_role_binding) | **PUT** /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name} | +*ResourceApi* | [**get_api_group**](docs/ResourceApi.md#get_api_group) | **GET** /apis/resource.k8s.io/ | +*ResourceV1Api* | [**create_device_class**](docs/ResourceV1Api.md#create_device_class) | **POST** /apis/resource.k8s.io/v1/deviceclasses | +*ResourceV1Api* | [**create_namespaced_resource_claim**](docs/ResourceV1Api.md#create_namespaced_resource_claim) | **POST** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims | +*ResourceV1Api* | [**create_namespaced_resource_claim_template**](docs/ResourceV1Api.md#create_namespaced_resource_claim_template) | **POST** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1Api* | [**create_resource_slice**](docs/ResourceV1Api.md#create_resource_slice) | **POST** /apis/resource.k8s.io/v1/resourceslices | +*ResourceV1Api* | [**delete_collection_device_class**](docs/ResourceV1Api.md#delete_collection_device_class) | **DELETE** /apis/resource.k8s.io/v1/deviceclasses | +*ResourceV1Api* | [**delete_collection_namespaced_resource_claim**](docs/ResourceV1Api.md#delete_collection_namespaced_resource_claim) | **DELETE** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims | +*ResourceV1Api* | [**delete_collection_namespaced_resource_claim_template**](docs/ResourceV1Api.md#delete_collection_namespaced_resource_claim_template) | **DELETE** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1Api* | [**delete_collection_resource_slice**](docs/ResourceV1Api.md#delete_collection_resource_slice) | **DELETE** /apis/resource.k8s.io/v1/resourceslices | +*ResourceV1Api* | [**delete_device_class**](docs/ResourceV1Api.md#delete_device_class) | **DELETE** /apis/resource.k8s.io/v1/deviceclasses/{name} | +*ResourceV1Api* | [**delete_namespaced_resource_claim**](docs/ResourceV1Api.md#delete_namespaced_resource_claim) | **DELETE** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1Api* | [**delete_namespaced_resource_claim_template**](docs/ResourceV1Api.md#delete_namespaced_resource_claim_template) | **DELETE** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1Api* | [**delete_resource_slice**](docs/ResourceV1Api.md#delete_resource_slice) | **DELETE** /apis/resource.k8s.io/v1/resourceslices/{name} | +*ResourceV1Api* | [**get_api_resources**](docs/ResourceV1Api.md#get_api_resources) | **GET** /apis/resource.k8s.io/v1/ | +*ResourceV1Api* | [**list_device_class**](docs/ResourceV1Api.md#list_device_class) | **GET** /apis/resource.k8s.io/v1/deviceclasses | +*ResourceV1Api* | [**list_namespaced_resource_claim**](docs/ResourceV1Api.md#list_namespaced_resource_claim) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims | +*ResourceV1Api* | [**list_namespaced_resource_claim_template**](docs/ResourceV1Api.md#list_namespaced_resource_claim_template) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1Api* | [**list_resource_claim_for_all_namespaces**](docs/ResourceV1Api.md#list_resource_claim_for_all_namespaces) | **GET** /apis/resource.k8s.io/v1/resourceclaims | +*ResourceV1Api* | [**list_resource_claim_template_for_all_namespaces**](docs/ResourceV1Api.md#list_resource_claim_template_for_all_namespaces) | **GET** /apis/resource.k8s.io/v1/resourceclaimtemplates | +*ResourceV1Api* | [**list_resource_slice**](docs/ResourceV1Api.md#list_resource_slice) | **GET** /apis/resource.k8s.io/v1/resourceslices | +*ResourceV1Api* | [**patch_device_class**](docs/ResourceV1Api.md#patch_device_class) | **PATCH** /apis/resource.k8s.io/v1/deviceclasses/{name} | +*ResourceV1Api* | [**patch_namespaced_resource_claim**](docs/ResourceV1Api.md#patch_namespaced_resource_claim) | **PATCH** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1Api* | [**patch_namespaced_resource_claim_status**](docs/ResourceV1Api.md#patch_namespaced_resource_claim_status) | **PATCH** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1Api* | [**patch_namespaced_resource_claim_template**](docs/ResourceV1Api.md#patch_namespaced_resource_claim_template) | **PATCH** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1Api* | [**patch_resource_slice**](docs/ResourceV1Api.md#patch_resource_slice) | **PATCH** /apis/resource.k8s.io/v1/resourceslices/{name} | +*ResourceV1Api* | [**read_device_class**](docs/ResourceV1Api.md#read_device_class) | **GET** /apis/resource.k8s.io/v1/deviceclasses/{name} | +*ResourceV1Api* | [**read_namespaced_resource_claim**](docs/ResourceV1Api.md#read_namespaced_resource_claim) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1Api* | [**read_namespaced_resource_claim_status**](docs/ResourceV1Api.md#read_namespaced_resource_claim_status) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1Api* | [**read_namespaced_resource_claim_template**](docs/ResourceV1Api.md#read_namespaced_resource_claim_template) | **GET** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1Api* | [**read_resource_slice**](docs/ResourceV1Api.md#read_resource_slice) | **GET** /apis/resource.k8s.io/v1/resourceslices/{name} | +*ResourceV1Api* | [**replace_device_class**](docs/ResourceV1Api.md#replace_device_class) | **PUT** /apis/resource.k8s.io/v1/deviceclasses/{name} | +*ResourceV1Api* | [**replace_namespaced_resource_claim**](docs/ResourceV1Api.md#replace_namespaced_resource_claim) | **PUT** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1Api* | [**replace_namespaced_resource_claim_status**](docs/ResourceV1Api.md#replace_namespaced_resource_claim_status) | **PUT** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1Api* | [**replace_namespaced_resource_claim_template**](docs/ResourceV1Api.md#replace_namespaced_resource_claim_template) | **PUT** /apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1Api* | [**replace_resource_slice**](docs/ResourceV1Api.md#replace_resource_slice) | **PUT** /apis/resource.k8s.io/v1/resourceslices/{name} | +*ResourceV1alpha3Api* | [**create_device_taint_rule**](docs/ResourceV1alpha3Api.md#create_device_taint_rule) | **POST** /apis/resource.k8s.io/v1alpha3/devicetaintrules | +*ResourceV1alpha3Api* | [**delete_collection_device_taint_rule**](docs/ResourceV1alpha3Api.md#delete_collection_device_taint_rule) | **DELETE** /apis/resource.k8s.io/v1alpha3/devicetaintrules | +*ResourceV1alpha3Api* | [**delete_device_taint_rule**](docs/ResourceV1alpha3Api.md#delete_device_taint_rule) | **DELETE** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | +*ResourceV1alpha3Api* | [**get_api_resources**](docs/ResourceV1alpha3Api.md#get_api_resources) | **GET** /apis/resource.k8s.io/v1alpha3/ | +*ResourceV1alpha3Api* | [**list_device_taint_rule**](docs/ResourceV1alpha3Api.md#list_device_taint_rule) | **GET** /apis/resource.k8s.io/v1alpha3/devicetaintrules | +*ResourceV1alpha3Api* | [**patch_device_taint_rule**](docs/ResourceV1alpha3Api.md#patch_device_taint_rule) | **PATCH** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | +*ResourceV1alpha3Api* | [**patch_device_taint_rule_status**](docs/ResourceV1alpha3Api.md#patch_device_taint_rule_status) | **PATCH** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}/status | +*ResourceV1alpha3Api* | [**read_device_taint_rule**](docs/ResourceV1alpha3Api.md#read_device_taint_rule) | **GET** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | +*ResourceV1alpha3Api* | [**read_device_taint_rule_status**](docs/ResourceV1alpha3Api.md#read_device_taint_rule_status) | **GET** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}/status | +*ResourceV1alpha3Api* | [**replace_device_taint_rule**](docs/ResourceV1alpha3Api.md#replace_device_taint_rule) | **PUT** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | +*ResourceV1alpha3Api* | [**replace_device_taint_rule_status**](docs/ResourceV1alpha3Api.md#replace_device_taint_rule_status) | **PUT** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}/status | +*ResourceV1beta1Api* | [**create_device_class**](docs/ResourceV1beta1Api.md#create_device_class) | **POST** /apis/resource.k8s.io/v1beta1/deviceclasses | +*ResourceV1beta1Api* | [**create_namespaced_resource_claim**](docs/ResourceV1beta1Api.md#create_namespaced_resource_claim) | **POST** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims | +*ResourceV1beta1Api* | [**create_namespaced_resource_claim_template**](docs/ResourceV1beta1Api.md#create_namespaced_resource_claim_template) | **POST** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1beta1Api* | [**create_resource_slice**](docs/ResourceV1beta1Api.md#create_resource_slice) | **POST** /apis/resource.k8s.io/v1beta1/resourceslices | +*ResourceV1beta1Api* | [**delete_collection_device_class**](docs/ResourceV1beta1Api.md#delete_collection_device_class) | **DELETE** /apis/resource.k8s.io/v1beta1/deviceclasses | +*ResourceV1beta1Api* | [**delete_collection_namespaced_resource_claim**](docs/ResourceV1beta1Api.md#delete_collection_namespaced_resource_claim) | **DELETE** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims | +*ResourceV1beta1Api* | [**delete_collection_namespaced_resource_claim_template**](docs/ResourceV1beta1Api.md#delete_collection_namespaced_resource_claim_template) | **DELETE** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1beta1Api* | [**delete_collection_resource_slice**](docs/ResourceV1beta1Api.md#delete_collection_resource_slice) | **DELETE** /apis/resource.k8s.io/v1beta1/resourceslices | +*ResourceV1beta1Api* | [**delete_device_class**](docs/ResourceV1beta1Api.md#delete_device_class) | **DELETE** /apis/resource.k8s.io/v1beta1/deviceclasses/{name} | +*ResourceV1beta1Api* | [**delete_namespaced_resource_claim**](docs/ResourceV1beta1Api.md#delete_namespaced_resource_claim) | **DELETE** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta1Api* | [**delete_namespaced_resource_claim_template**](docs/ResourceV1beta1Api.md#delete_namespaced_resource_claim_template) | **DELETE** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta1Api* | [**delete_resource_slice**](docs/ResourceV1beta1Api.md#delete_resource_slice) | **DELETE** /apis/resource.k8s.io/v1beta1/resourceslices/{name} | +*ResourceV1beta1Api* | [**get_api_resources**](docs/ResourceV1beta1Api.md#get_api_resources) | **GET** /apis/resource.k8s.io/v1beta1/ | +*ResourceV1beta1Api* | [**list_device_class**](docs/ResourceV1beta1Api.md#list_device_class) | **GET** /apis/resource.k8s.io/v1beta1/deviceclasses | +*ResourceV1beta1Api* | [**list_namespaced_resource_claim**](docs/ResourceV1beta1Api.md#list_namespaced_resource_claim) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims | +*ResourceV1beta1Api* | [**list_namespaced_resource_claim_template**](docs/ResourceV1beta1Api.md#list_namespaced_resource_claim_template) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1beta1Api* | [**list_resource_claim_for_all_namespaces**](docs/ResourceV1beta1Api.md#list_resource_claim_for_all_namespaces) | **GET** /apis/resource.k8s.io/v1beta1/resourceclaims | +*ResourceV1beta1Api* | [**list_resource_claim_template_for_all_namespaces**](docs/ResourceV1beta1Api.md#list_resource_claim_template_for_all_namespaces) | **GET** /apis/resource.k8s.io/v1beta1/resourceclaimtemplates | +*ResourceV1beta1Api* | [**list_resource_slice**](docs/ResourceV1beta1Api.md#list_resource_slice) | **GET** /apis/resource.k8s.io/v1beta1/resourceslices | +*ResourceV1beta1Api* | [**patch_device_class**](docs/ResourceV1beta1Api.md#patch_device_class) | **PATCH** /apis/resource.k8s.io/v1beta1/deviceclasses/{name} | +*ResourceV1beta1Api* | [**patch_namespaced_resource_claim**](docs/ResourceV1beta1Api.md#patch_namespaced_resource_claim) | **PATCH** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta1Api* | [**patch_namespaced_resource_claim_status**](docs/ResourceV1beta1Api.md#patch_namespaced_resource_claim_status) | **PATCH** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1beta1Api* | [**patch_namespaced_resource_claim_template**](docs/ResourceV1beta1Api.md#patch_namespaced_resource_claim_template) | **PATCH** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta1Api* | [**patch_resource_slice**](docs/ResourceV1beta1Api.md#patch_resource_slice) | **PATCH** /apis/resource.k8s.io/v1beta1/resourceslices/{name} | +*ResourceV1beta1Api* | [**read_device_class**](docs/ResourceV1beta1Api.md#read_device_class) | **GET** /apis/resource.k8s.io/v1beta1/deviceclasses/{name} | +*ResourceV1beta1Api* | [**read_namespaced_resource_claim**](docs/ResourceV1beta1Api.md#read_namespaced_resource_claim) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta1Api* | [**read_namespaced_resource_claim_status**](docs/ResourceV1beta1Api.md#read_namespaced_resource_claim_status) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1beta1Api* | [**read_namespaced_resource_claim_template**](docs/ResourceV1beta1Api.md#read_namespaced_resource_claim_template) | **GET** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta1Api* | [**read_resource_slice**](docs/ResourceV1beta1Api.md#read_resource_slice) | **GET** /apis/resource.k8s.io/v1beta1/resourceslices/{name} | +*ResourceV1beta1Api* | [**replace_device_class**](docs/ResourceV1beta1Api.md#replace_device_class) | **PUT** /apis/resource.k8s.io/v1beta1/deviceclasses/{name} | +*ResourceV1beta1Api* | [**replace_namespaced_resource_claim**](docs/ResourceV1beta1Api.md#replace_namespaced_resource_claim) | **PUT** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta1Api* | [**replace_namespaced_resource_claim_status**](docs/ResourceV1beta1Api.md#replace_namespaced_resource_claim_status) | **PUT** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1beta1Api* | [**replace_namespaced_resource_claim_template**](docs/ResourceV1beta1Api.md#replace_namespaced_resource_claim_template) | **PUT** /apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta1Api* | [**replace_resource_slice**](docs/ResourceV1beta1Api.md#replace_resource_slice) | **PUT** /apis/resource.k8s.io/v1beta1/resourceslices/{name} | +*ResourceV1beta2Api* | [**create_device_class**](docs/ResourceV1beta2Api.md#create_device_class) | **POST** /apis/resource.k8s.io/v1beta2/deviceclasses | +*ResourceV1beta2Api* | [**create_namespaced_resource_claim**](docs/ResourceV1beta2Api.md#create_namespaced_resource_claim) | **POST** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims | +*ResourceV1beta2Api* | [**create_namespaced_resource_claim_template**](docs/ResourceV1beta2Api.md#create_namespaced_resource_claim_template) | **POST** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1beta2Api* | [**create_resource_slice**](docs/ResourceV1beta2Api.md#create_resource_slice) | **POST** /apis/resource.k8s.io/v1beta2/resourceslices | +*ResourceV1beta2Api* | [**delete_collection_device_class**](docs/ResourceV1beta2Api.md#delete_collection_device_class) | **DELETE** /apis/resource.k8s.io/v1beta2/deviceclasses | +*ResourceV1beta2Api* | [**delete_collection_namespaced_resource_claim**](docs/ResourceV1beta2Api.md#delete_collection_namespaced_resource_claim) | **DELETE** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims | +*ResourceV1beta2Api* | [**delete_collection_namespaced_resource_claim_template**](docs/ResourceV1beta2Api.md#delete_collection_namespaced_resource_claim_template) | **DELETE** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1beta2Api* | [**delete_collection_resource_slice**](docs/ResourceV1beta2Api.md#delete_collection_resource_slice) | **DELETE** /apis/resource.k8s.io/v1beta2/resourceslices | +*ResourceV1beta2Api* | [**delete_device_class**](docs/ResourceV1beta2Api.md#delete_device_class) | **DELETE** /apis/resource.k8s.io/v1beta2/deviceclasses/{name} | +*ResourceV1beta2Api* | [**delete_namespaced_resource_claim**](docs/ResourceV1beta2Api.md#delete_namespaced_resource_claim) | **DELETE** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta2Api* | [**delete_namespaced_resource_claim_template**](docs/ResourceV1beta2Api.md#delete_namespaced_resource_claim_template) | **DELETE** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta2Api* | [**delete_resource_slice**](docs/ResourceV1beta2Api.md#delete_resource_slice) | **DELETE** /apis/resource.k8s.io/v1beta2/resourceslices/{name} | +*ResourceV1beta2Api* | [**get_api_resources**](docs/ResourceV1beta2Api.md#get_api_resources) | **GET** /apis/resource.k8s.io/v1beta2/ | +*ResourceV1beta2Api* | [**list_device_class**](docs/ResourceV1beta2Api.md#list_device_class) | **GET** /apis/resource.k8s.io/v1beta2/deviceclasses | +*ResourceV1beta2Api* | [**list_namespaced_resource_claim**](docs/ResourceV1beta2Api.md#list_namespaced_resource_claim) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims | +*ResourceV1beta2Api* | [**list_namespaced_resource_claim_template**](docs/ResourceV1beta2Api.md#list_namespaced_resource_claim_template) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates | +*ResourceV1beta2Api* | [**list_resource_claim_for_all_namespaces**](docs/ResourceV1beta2Api.md#list_resource_claim_for_all_namespaces) | **GET** /apis/resource.k8s.io/v1beta2/resourceclaims | +*ResourceV1beta2Api* | [**list_resource_claim_template_for_all_namespaces**](docs/ResourceV1beta2Api.md#list_resource_claim_template_for_all_namespaces) | **GET** /apis/resource.k8s.io/v1beta2/resourceclaimtemplates | +*ResourceV1beta2Api* | [**list_resource_slice**](docs/ResourceV1beta2Api.md#list_resource_slice) | **GET** /apis/resource.k8s.io/v1beta2/resourceslices | +*ResourceV1beta2Api* | [**patch_device_class**](docs/ResourceV1beta2Api.md#patch_device_class) | **PATCH** /apis/resource.k8s.io/v1beta2/deviceclasses/{name} | +*ResourceV1beta2Api* | [**patch_namespaced_resource_claim**](docs/ResourceV1beta2Api.md#patch_namespaced_resource_claim) | **PATCH** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta2Api* | [**patch_namespaced_resource_claim_status**](docs/ResourceV1beta2Api.md#patch_namespaced_resource_claim_status) | **PATCH** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1beta2Api* | [**patch_namespaced_resource_claim_template**](docs/ResourceV1beta2Api.md#patch_namespaced_resource_claim_template) | **PATCH** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta2Api* | [**patch_resource_slice**](docs/ResourceV1beta2Api.md#patch_resource_slice) | **PATCH** /apis/resource.k8s.io/v1beta2/resourceslices/{name} | +*ResourceV1beta2Api* | [**read_device_class**](docs/ResourceV1beta2Api.md#read_device_class) | **GET** /apis/resource.k8s.io/v1beta2/deviceclasses/{name} | +*ResourceV1beta2Api* | [**read_namespaced_resource_claim**](docs/ResourceV1beta2Api.md#read_namespaced_resource_claim) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta2Api* | [**read_namespaced_resource_claim_status**](docs/ResourceV1beta2Api.md#read_namespaced_resource_claim_status) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1beta2Api* | [**read_namespaced_resource_claim_template**](docs/ResourceV1beta2Api.md#read_namespaced_resource_claim_template) | **GET** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta2Api* | [**read_resource_slice**](docs/ResourceV1beta2Api.md#read_resource_slice) | **GET** /apis/resource.k8s.io/v1beta2/resourceslices/{name} | +*ResourceV1beta2Api* | [**replace_device_class**](docs/ResourceV1beta2Api.md#replace_device_class) | **PUT** /apis/resource.k8s.io/v1beta2/deviceclasses/{name} | +*ResourceV1beta2Api* | [**replace_namespaced_resource_claim**](docs/ResourceV1beta2Api.md#replace_namespaced_resource_claim) | **PUT** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name} | +*ResourceV1beta2Api* | [**replace_namespaced_resource_claim_status**](docs/ResourceV1beta2Api.md#replace_namespaced_resource_claim_status) | **PUT** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status | +*ResourceV1beta2Api* | [**replace_namespaced_resource_claim_template**](docs/ResourceV1beta2Api.md#replace_namespaced_resource_claim_template) | **PUT** /apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name} | +*ResourceV1beta2Api* | [**replace_resource_slice**](docs/ResourceV1beta2Api.md#replace_resource_slice) | **PUT** /apis/resource.k8s.io/v1beta2/resourceslices/{name} | +*SchedulingApi* | [**get_api_group**](docs/SchedulingApi.md#get_api_group) | **GET** /apis/scheduling.k8s.io/ | +*SchedulingV1Api* | [**create_priority_class**](docs/SchedulingV1Api.md#create_priority_class) | **POST** /apis/scheduling.k8s.io/v1/priorityclasses | +*SchedulingV1Api* | [**delete_collection_priority_class**](docs/SchedulingV1Api.md#delete_collection_priority_class) | **DELETE** /apis/scheduling.k8s.io/v1/priorityclasses | +*SchedulingV1Api* | [**delete_priority_class**](docs/SchedulingV1Api.md#delete_priority_class) | **DELETE** /apis/scheduling.k8s.io/v1/priorityclasses/{name} | +*SchedulingV1Api* | [**get_api_resources**](docs/SchedulingV1Api.md#get_api_resources) | **GET** /apis/scheduling.k8s.io/v1/ | +*SchedulingV1Api* | [**list_priority_class**](docs/SchedulingV1Api.md#list_priority_class) | **GET** /apis/scheduling.k8s.io/v1/priorityclasses | +*SchedulingV1Api* | [**patch_priority_class**](docs/SchedulingV1Api.md#patch_priority_class) | **PATCH** /apis/scheduling.k8s.io/v1/priorityclasses/{name} | +*SchedulingV1Api* | [**read_priority_class**](docs/SchedulingV1Api.md#read_priority_class) | **GET** /apis/scheduling.k8s.io/v1/priorityclasses/{name} | +*SchedulingV1Api* | [**replace_priority_class**](docs/SchedulingV1Api.md#replace_priority_class) | **PUT** /apis/scheduling.k8s.io/v1/priorityclasses/{name} | +*SchedulingV1alpha1Api* | [**create_namespaced_workload**](docs/SchedulingV1alpha1Api.md#create_namespaced_workload) | **POST** /apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads | +*SchedulingV1alpha1Api* | [**delete_collection_namespaced_workload**](docs/SchedulingV1alpha1Api.md#delete_collection_namespaced_workload) | **DELETE** /apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads | +*SchedulingV1alpha1Api* | [**delete_namespaced_workload**](docs/SchedulingV1alpha1Api.md#delete_namespaced_workload) | **DELETE** /apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads/{name} | +*SchedulingV1alpha1Api* | [**get_api_resources**](docs/SchedulingV1alpha1Api.md#get_api_resources) | **GET** /apis/scheduling.k8s.io/v1alpha1/ | +*SchedulingV1alpha1Api* | [**list_namespaced_workload**](docs/SchedulingV1alpha1Api.md#list_namespaced_workload) | **GET** /apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads | +*SchedulingV1alpha1Api* | [**list_workload_for_all_namespaces**](docs/SchedulingV1alpha1Api.md#list_workload_for_all_namespaces) | **GET** /apis/scheduling.k8s.io/v1alpha1/workloads | +*SchedulingV1alpha1Api* | [**patch_namespaced_workload**](docs/SchedulingV1alpha1Api.md#patch_namespaced_workload) | **PATCH** /apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads/{name} | +*SchedulingV1alpha1Api* | [**read_namespaced_workload**](docs/SchedulingV1alpha1Api.md#read_namespaced_workload) | **GET** /apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads/{name} | +*SchedulingV1alpha1Api* | [**replace_namespaced_workload**](docs/SchedulingV1alpha1Api.md#replace_namespaced_workload) | **PUT** /apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads/{name} | +*StorageApi* | [**get_api_group**](docs/StorageApi.md#get_api_group) | **GET** /apis/storage.k8s.io/ | +*StorageV1Api* | [**create_csi_driver**](docs/StorageV1Api.md#create_csi_driver) | **POST** /apis/storage.k8s.io/v1/csidrivers | +*StorageV1Api* | [**create_csi_node**](docs/StorageV1Api.md#create_csi_node) | **POST** /apis/storage.k8s.io/v1/csinodes | +*StorageV1Api* | [**create_namespaced_csi_storage_capacity**](docs/StorageV1Api.md#create_namespaced_csi_storage_capacity) | **POST** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities | +*StorageV1Api* | [**create_storage_class**](docs/StorageV1Api.md#create_storage_class) | **POST** /apis/storage.k8s.io/v1/storageclasses | +*StorageV1Api* | [**create_volume_attachment**](docs/StorageV1Api.md#create_volume_attachment) | **POST** /apis/storage.k8s.io/v1/volumeattachments | +*StorageV1Api* | [**create_volume_attributes_class**](docs/StorageV1Api.md#create_volume_attributes_class) | **POST** /apis/storage.k8s.io/v1/volumeattributesclasses | +*StorageV1Api* | [**delete_collection_csi_driver**](docs/StorageV1Api.md#delete_collection_csi_driver) | **DELETE** /apis/storage.k8s.io/v1/csidrivers | +*StorageV1Api* | [**delete_collection_csi_node**](docs/StorageV1Api.md#delete_collection_csi_node) | **DELETE** /apis/storage.k8s.io/v1/csinodes | +*StorageV1Api* | [**delete_collection_namespaced_csi_storage_capacity**](docs/StorageV1Api.md#delete_collection_namespaced_csi_storage_capacity) | **DELETE** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities | +*StorageV1Api* | [**delete_collection_storage_class**](docs/StorageV1Api.md#delete_collection_storage_class) | **DELETE** /apis/storage.k8s.io/v1/storageclasses | +*StorageV1Api* | [**delete_collection_volume_attachment**](docs/StorageV1Api.md#delete_collection_volume_attachment) | **DELETE** /apis/storage.k8s.io/v1/volumeattachments | +*StorageV1Api* | [**delete_collection_volume_attributes_class**](docs/StorageV1Api.md#delete_collection_volume_attributes_class) | **DELETE** /apis/storage.k8s.io/v1/volumeattributesclasses | +*StorageV1Api* | [**delete_csi_driver**](docs/StorageV1Api.md#delete_csi_driver) | **DELETE** /apis/storage.k8s.io/v1/csidrivers/{name} | +*StorageV1Api* | [**delete_csi_node**](docs/StorageV1Api.md#delete_csi_node) | **DELETE** /apis/storage.k8s.io/v1/csinodes/{name} | +*StorageV1Api* | [**delete_namespaced_csi_storage_capacity**](docs/StorageV1Api.md#delete_namespaced_csi_storage_capacity) | **DELETE** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name} | +*StorageV1Api* | [**delete_storage_class**](docs/StorageV1Api.md#delete_storage_class) | **DELETE** /apis/storage.k8s.io/v1/storageclasses/{name} | +*StorageV1Api* | [**delete_volume_attachment**](docs/StorageV1Api.md#delete_volume_attachment) | **DELETE** /apis/storage.k8s.io/v1/volumeattachments/{name} | +*StorageV1Api* | [**delete_volume_attributes_class**](docs/StorageV1Api.md#delete_volume_attributes_class) | **DELETE** /apis/storage.k8s.io/v1/volumeattributesclasses/{name} | +*StorageV1Api* | [**get_api_resources**](docs/StorageV1Api.md#get_api_resources) | **GET** /apis/storage.k8s.io/v1/ | +*StorageV1Api* | [**list_csi_driver**](docs/StorageV1Api.md#list_csi_driver) | **GET** /apis/storage.k8s.io/v1/csidrivers | +*StorageV1Api* | [**list_csi_node**](docs/StorageV1Api.md#list_csi_node) | **GET** /apis/storage.k8s.io/v1/csinodes | +*StorageV1Api* | [**list_csi_storage_capacity_for_all_namespaces**](docs/StorageV1Api.md#list_csi_storage_capacity_for_all_namespaces) | **GET** /apis/storage.k8s.io/v1/csistoragecapacities | +*StorageV1Api* | [**list_namespaced_csi_storage_capacity**](docs/StorageV1Api.md#list_namespaced_csi_storage_capacity) | **GET** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities | +*StorageV1Api* | [**list_storage_class**](docs/StorageV1Api.md#list_storage_class) | **GET** /apis/storage.k8s.io/v1/storageclasses | +*StorageV1Api* | [**list_volume_attachment**](docs/StorageV1Api.md#list_volume_attachment) | **GET** /apis/storage.k8s.io/v1/volumeattachments | +*StorageV1Api* | [**list_volume_attributes_class**](docs/StorageV1Api.md#list_volume_attributes_class) | **GET** /apis/storage.k8s.io/v1/volumeattributesclasses | +*StorageV1Api* | [**patch_csi_driver**](docs/StorageV1Api.md#patch_csi_driver) | **PATCH** /apis/storage.k8s.io/v1/csidrivers/{name} | +*StorageV1Api* | [**patch_csi_node**](docs/StorageV1Api.md#patch_csi_node) | **PATCH** /apis/storage.k8s.io/v1/csinodes/{name} | +*StorageV1Api* | [**patch_namespaced_csi_storage_capacity**](docs/StorageV1Api.md#patch_namespaced_csi_storage_capacity) | **PATCH** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name} | +*StorageV1Api* | [**patch_storage_class**](docs/StorageV1Api.md#patch_storage_class) | **PATCH** /apis/storage.k8s.io/v1/storageclasses/{name} | +*StorageV1Api* | [**patch_volume_attachment**](docs/StorageV1Api.md#patch_volume_attachment) | **PATCH** /apis/storage.k8s.io/v1/volumeattachments/{name} | +*StorageV1Api* | [**patch_volume_attachment_status**](docs/StorageV1Api.md#patch_volume_attachment_status) | **PATCH** /apis/storage.k8s.io/v1/volumeattachments/{name}/status | +*StorageV1Api* | [**patch_volume_attributes_class**](docs/StorageV1Api.md#patch_volume_attributes_class) | **PATCH** /apis/storage.k8s.io/v1/volumeattributesclasses/{name} | +*StorageV1Api* | [**read_csi_driver**](docs/StorageV1Api.md#read_csi_driver) | **GET** /apis/storage.k8s.io/v1/csidrivers/{name} | +*StorageV1Api* | [**read_csi_node**](docs/StorageV1Api.md#read_csi_node) | **GET** /apis/storage.k8s.io/v1/csinodes/{name} | +*StorageV1Api* | [**read_namespaced_csi_storage_capacity**](docs/StorageV1Api.md#read_namespaced_csi_storage_capacity) | **GET** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name} | +*StorageV1Api* | [**read_storage_class**](docs/StorageV1Api.md#read_storage_class) | **GET** /apis/storage.k8s.io/v1/storageclasses/{name} | +*StorageV1Api* | [**read_volume_attachment**](docs/StorageV1Api.md#read_volume_attachment) | **GET** /apis/storage.k8s.io/v1/volumeattachments/{name} | +*StorageV1Api* | [**read_volume_attachment_status**](docs/StorageV1Api.md#read_volume_attachment_status) | **GET** /apis/storage.k8s.io/v1/volumeattachments/{name}/status | +*StorageV1Api* | [**read_volume_attributes_class**](docs/StorageV1Api.md#read_volume_attributes_class) | **GET** /apis/storage.k8s.io/v1/volumeattributesclasses/{name} | +*StorageV1Api* | [**replace_csi_driver**](docs/StorageV1Api.md#replace_csi_driver) | **PUT** /apis/storage.k8s.io/v1/csidrivers/{name} | +*StorageV1Api* | [**replace_csi_node**](docs/StorageV1Api.md#replace_csi_node) | **PUT** /apis/storage.k8s.io/v1/csinodes/{name} | +*StorageV1Api* | [**replace_namespaced_csi_storage_capacity**](docs/StorageV1Api.md#replace_namespaced_csi_storage_capacity) | **PUT** /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name} | +*StorageV1Api* | [**replace_storage_class**](docs/StorageV1Api.md#replace_storage_class) | **PUT** /apis/storage.k8s.io/v1/storageclasses/{name} | +*StorageV1Api* | [**replace_volume_attachment**](docs/StorageV1Api.md#replace_volume_attachment) | **PUT** /apis/storage.k8s.io/v1/volumeattachments/{name} | +*StorageV1Api* | [**replace_volume_attachment_status**](docs/StorageV1Api.md#replace_volume_attachment_status) | **PUT** /apis/storage.k8s.io/v1/volumeattachments/{name}/status | +*StorageV1Api* | [**replace_volume_attributes_class**](docs/StorageV1Api.md#replace_volume_attributes_class) | **PUT** /apis/storage.k8s.io/v1/volumeattributesclasses/{name} | +*StorageV1beta1Api* | [**create_volume_attributes_class**](docs/StorageV1beta1Api.md#create_volume_attributes_class) | **POST** /apis/storage.k8s.io/v1beta1/volumeattributesclasses | +*StorageV1beta1Api* | [**delete_collection_volume_attributes_class**](docs/StorageV1beta1Api.md#delete_collection_volume_attributes_class) | **DELETE** /apis/storage.k8s.io/v1beta1/volumeattributesclasses | +*StorageV1beta1Api* | [**delete_volume_attributes_class**](docs/StorageV1beta1Api.md#delete_volume_attributes_class) | **DELETE** /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} | +*StorageV1beta1Api* | [**get_api_resources**](docs/StorageV1beta1Api.md#get_api_resources) | **GET** /apis/storage.k8s.io/v1beta1/ | +*StorageV1beta1Api* | [**list_volume_attributes_class**](docs/StorageV1beta1Api.md#list_volume_attributes_class) | **GET** /apis/storage.k8s.io/v1beta1/volumeattributesclasses | +*StorageV1beta1Api* | [**patch_volume_attributes_class**](docs/StorageV1beta1Api.md#patch_volume_attributes_class) | **PATCH** /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} | +*StorageV1beta1Api* | [**read_volume_attributes_class**](docs/StorageV1beta1Api.md#read_volume_attributes_class) | **GET** /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} | +*StorageV1beta1Api* | [**replace_volume_attributes_class**](docs/StorageV1beta1Api.md#replace_volume_attributes_class) | **PUT** /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} | +*StoragemigrationApi* | [**get_api_group**](docs/StoragemigrationApi.md#get_api_group) | **GET** /apis/storagemigration.k8s.io/ | +*StoragemigrationV1beta1Api* | [**create_storage_version_migration**](docs/StoragemigrationV1beta1Api.md#create_storage_version_migration) | **POST** /apis/storagemigration.k8s.io/v1beta1/storageversionmigrations | +*StoragemigrationV1beta1Api* | [**delete_collection_storage_version_migration**](docs/StoragemigrationV1beta1Api.md#delete_collection_storage_version_migration) | **DELETE** /apis/storagemigration.k8s.io/v1beta1/storageversionmigrations | +*StoragemigrationV1beta1Api* | [**delete_storage_version_migration**](docs/StoragemigrationV1beta1Api.md#delete_storage_version_migration) | **DELETE** /apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name} | +*StoragemigrationV1beta1Api* | [**get_api_resources**](docs/StoragemigrationV1beta1Api.md#get_api_resources) | **GET** /apis/storagemigration.k8s.io/v1beta1/ | +*StoragemigrationV1beta1Api* | [**list_storage_version_migration**](docs/StoragemigrationV1beta1Api.md#list_storage_version_migration) | **GET** /apis/storagemigration.k8s.io/v1beta1/storageversionmigrations | +*StoragemigrationV1beta1Api* | [**patch_storage_version_migration**](docs/StoragemigrationV1beta1Api.md#patch_storage_version_migration) | **PATCH** /apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name} | +*StoragemigrationV1beta1Api* | [**patch_storage_version_migration_status**](docs/StoragemigrationV1beta1Api.md#patch_storage_version_migration_status) | **PATCH** /apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name}/status | +*StoragemigrationV1beta1Api* | [**read_storage_version_migration**](docs/StoragemigrationV1beta1Api.md#read_storage_version_migration) | **GET** /apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name} | +*StoragemigrationV1beta1Api* | [**read_storage_version_migration_status**](docs/StoragemigrationV1beta1Api.md#read_storage_version_migration_status) | **GET** /apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name}/status | +*StoragemigrationV1beta1Api* | [**replace_storage_version_migration**](docs/StoragemigrationV1beta1Api.md#replace_storage_version_migration) | **PUT** /apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name} | +*StoragemigrationV1beta1Api* | [**replace_storage_version_migration_status**](docs/StoragemigrationV1beta1Api.md#replace_storage_version_migration_status) | **PUT** /apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name}/status | +*VersionApi* | [**get_code**](docs/VersionApi.md#get_code) | **GET** /version/ | + + +## Documentation For Models + + - [AdmissionregistrationV1ServiceReference](docs/AdmissionregistrationV1ServiceReference.md) + - [AdmissionregistrationV1WebhookClientConfig](docs/AdmissionregistrationV1WebhookClientConfig.md) + - [ApiextensionsV1ServiceReference](docs/ApiextensionsV1ServiceReference.md) + - [ApiextensionsV1WebhookClientConfig](docs/ApiextensionsV1WebhookClientConfig.md) + - [ApiregistrationV1ServiceReference](docs/ApiregistrationV1ServiceReference.md) + - [AuthenticationV1TokenRequest](docs/AuthenticationV1TokenRequest.md) + - [CoreV1EndpointPort](docs/CoreV1EndpointPort.md) + - [CoreV1Event](docs/CoreV1Event.md) + - [CoreV1EventList](docs/CoreV1EventList.md) + - [CoreV1EventSeries](docs/CoreV1EventSeries.md) + - [CoreV1ResourceClaim](docs/CoreV1ResourceClaim.md) + - [DiscoveryV1EndpointPort](docs/DiscoveryV1EndpointPort.md) + - [EventsV1Event](docs/EventsV1Event.md) + - [EventsV1EventList](docs/EventsV1EventList.md) + - [EventsV1EventSeries](docs/EventsV1EventSeries.md) + - [FlowcontrolV1Subject](docs/FlowcontrolV1Subject.md) + - [RbacV1Subject](docs/RbacV1Subject.md) + - [ResourceV1ResourceClaim](docs/ResourceV1ResourceClaim.md) + - [StorageV1TokenRequest](docs/StorageV1TokenRequest.md) + - [V1APIGroup](docs/V1APIGroup.md) + - [V1APIGroupList](docs/V1APIGroupList.md) + - [V1APIResource](docs/V1APIResource.md) + - [V1APIResourceList](docs/V1APIResourceList.md) + - [V1APIService](docs/V1APIService.md) + - [V1APIServiceCondition](docs/V1APIServiceCondition.md) + - [V1APIServiceList](docs/V1APIServiceList.md) + - [V1APIServiceSpec](docs/V1APIServiceSpec.md) + - [V1APIServiceStatus](docs/V1APIServiceStatus.md) + - [V1APIVersions](docs/V1APIVersions.md) + - [V1AWSElasticBlockStoreVolumeSource](docs/V1AWSElasticBlockStoreVolumeSource.md) + - [V1Affinity](docs/V1Affinity.md) + - [V1AggregationRule](docs/V1AggregationRule.md) + - [V1AllocatedDeviceStatus](docs/V1AllocatedDeviceStatus.md) + - [V1AllocationResult](docs/V1AllocationResult.md) + - [V1AppArmorProfile](docs/V1AppArmorProfile.md) + - [V1AttachedVolume](docs/V1AttachedVolume.md) + - [V1AuditAnnotation](docs/V1AuditAnnotation.md) + - [V1AzureDiskVolumeSource](docs/V1AzureDiskVolumeSource.md) + - [V1AzureFilePersistentVolumeSource](docs/V1AzureFilePersistentVolumeSource.md) + - [V1AzureFileVolumeSource](docs/V1AzureFileVolumeSource.md) + - [V1Binding](docs/V1Binding.md) + - [V1BoundObjectReference](docs/V1BoundObjectReference.md) + - [V1CELDeviceSelector](docs/V1CELDeviceSelector.md) + - [V1CSIDriver](docs/V1CSIDriver.md) + - [V1CSIDriverList](docs/V1CSIDriverList.md) + - [V1CSIDriverSpec](docs/V1CSIDriverSpec.md) + - [V1CSINode](docs/V1CSINode.md) + - [V1CSINodeDriver](docs/V1CSINodeDriver.md) + - [V1CSINodeList](docs/V1CSINodeList.md) + - [V1CSINodeSpec](docs/V1CSINodeSpec.md) + - [V1CSIPersistentVolumeSource](docs/V1CSIPersistentVolumeSource.md) + - [V1CSIStorageCapacity](docs/V1CSIStorageCapacity.md) + - [V1CSIStorageCapacityList](docs/V1CSIStorageCapacityList.md) + - [V1CSIVolumeSource](docs/V1CSIVolumeSource.md) + - [V1Capabilities](docs/V1Capabilities.md) + - [V1CapacityRequestPolicy](docs/V1CapacityRequestPolicy.md) + - [V1CapacityRequestPolicyRange](docs/V1CapacityRequestPolicyRange.md) + - [V1CapacityRequirements](docs/V1CapacityRequirements.md) + - [V1CephFSPersistentVolumeSource](docs/V1CephFSPersistentVolumeSource.md) + - [V1CephFSVolumeSource](docs/V1CephFSVolumeSource.md) + - [V1CertificateSigningRequest](docs/V1CertificateSigningRequest.md) + - [V1CertificateSigningRequestCondition](docs/V1CertificateSigningRequestCondition.md) + - [V1CertificateSigningRequestList](docs/V1CertificateSigningRequestList.md) + - [V1CertificateSigningRequestSpec](docs/V1CertificateSigningRequestSpec.md) + - [V1CertificateSigningRequestStatus](docs/V1CertificateSigningRequestStatus.md) + - [V1CinderPersistentVolumeSource](docs/V1CinderPersistentVolumeSource.md) + - [V1CinderVolumeSource](docs/V1CinderVolumeSource.md) + - [V1ClientIPConfig](docs/V1ClientIPConfig.md) + - [V1ClusterRole](docs/V1ClusterRole.md) + - [V1ClusterRoleBinding](docs/V1ClusterRoleBinding.md) + - [V1ClusterRoleBindingList](docs/V1ClusterRoleBindingList.md) + - [V1ClusterRoleList](docs/V1ClusterRoleList.md) + - [V1ClusterTrustBundleProjection](docs/V1ClusterTrustBundleProjection.md) + - [V1ComponentCondition](docs/V1ComponentCondition.md) + - [V1ComponentStatus](docs/V1ComponentStatus.md) + - [V1ComponentStatusList](docs/V1ComponentStatusList.md) + - [V1Condition](docs/V1Condition.md) + - [V1ConfigMap](docs/V1ConfigMap.md) + - [V1ConfigMapEnvSource](docs/V1ConfigMapEnvSource.md) + - [V1ConfigMapKeySelector](docs/V1ConfigMapKeySelector.md) + - [V1ConfigMapList](docs/V1ConfigMapList.md) + - [V1ConfigMapNodeConfigSource](docs/V1ConfigMapNodeConfigSource.md) + - [V1ConfigMapProjection](docs/V1ConfigMapProjection.md) + - [V1ConfigMapVolumeSource](docs/V1ConfigMapVolumeSource.md) + - [V1Container](docs/V1Container.md) + - [V1ContainerExtendedResourceRequest](docs/V1ContainerExtendedResourceRequest.md) + - [V1ContainerImage](docs/V1ContainerImage.md) + - [V1ContainerPort](docs/V1ContainerPort.md) + - [V1ContainerResizePolicy](docs/V1ContainerResizePolicy.md) + - [V1ContainerRestartRule](docs/V1ContainerRestartRule.md) + - [V1ContainerRestartRuleOnExitCodes](docs/V1ContainerRestartRuleOnExitCodes.md) + - [V1ContainerState](docs/V1ContainerState.md) + - [V1ContainerStateRunning](docs/V1ContainerStateRunning.md) + - [V1ContainerStateTerminated](docs/V1ContainerStateTerminated.md) + - [V1ContainerStateWaiting](docs/V1ContainerStateWaiting.md) + - [V1ContainerStatus](docs/V1ContainerStatus.md) + - [V1ContainerUser](docs/V1ContainerUser.md) + - [V1ControllerRevision](docs/V1ControllerRevision.md) + - [V1ControllerRevisionList](docs/V1ControllerRevisionList.md) + - [V1Counter](docs/V1Counter.md) + - [V1CounterSet](docs/V1CounterSet.md) + - [V1CronJob](docs/V1CronJob.md) + - [V1CronJobList](docs/V1CronJobList.md) + - [V1CronJobSpec](docs/V1CronJobSpec.md) + - [V1CronJobStatus](docs/V1CronJobStatus.md) + - [V1CrossVersionObjectReference](docs/V1CrossVersionObjectReference.md) + - [V1CustomResourceColumnDefinition](docs/V1CustomResourceColumnDefinition.md) + - [V1CustomResourceConversion](docs/V1CustomResourceConversion.md) + - [V1CustomResourceDefinition](docs/V1CustomResourceDefinition.md) + - [V1CustomResourceDefinitionCondition](docs/V1CustomResourceDefinitionCondition.md) + - [V1CustomResourceDefinitionList](docs/V1CustomResourceDefinitionList.md) + - [V1CustomResourceDefinitionNames](docs/V1CustomResourceDefinitionNames.md) + - [V1CustomResourceDefinitionSpec](docs/V1CustomResourceDefinitionSpec.md) + - [V1CustomResourceDefinitionStatus](docs/V1CustomResourceDefinitionStatus.md) + - [V1CustomResourceDefinitionVersion](docs/V1CustomResourceDefinitionVersion.md) + - [V1CustomResourceSubresourceScale](docs/V1CustomResourceSubresourceScale.md) + - [V1CustomResourceSubresources](docs/V1CustomResourceSubresources.md) + - [V1CustomResourceValidation](docs/V1CustomResourceValidation.md) + - [V1DaemonEndpoint](docs/V1DaemonEndpoint.md) + - [V1DaemonSet](docs/V1DaemonSet.md) + - [V1DaemonSetCondition](docs/V1DaemonSetCondition.md) + - [V1DaemonSetList](docs/V1DaemonSetList.md) + - [V1DaemonSetSpec](docs/V1DaemonSetSpec.md) + - [V1DaemonSetStatus](docs/V1DaemonSetStatus.md) + - [V1DaemonSetUpdateStrategy](docs/V1DaemonSetUpdateStrategy.md) + - [V1DeleteOptions](docs/V1DeleteOptions.md) + - [V1Deployment](docs/V1Deployment.md) + - [V1DeploymentCondition](docs/V1DeploymentCondition.md) + - [V1DeploymentList](docs/V1DeploymentList.md) + - [V1DeploymentSpec](docs/V1DeploymentSpec.md) + - [V1DeploymentStatus](docs/V1DeploymentStatus.md) + - [V1DeploymentStrategy](docs/V1DeploymentStrategy.md) + - [V1Device](docs/V1Device.md) + - [V1DeviceAllocationConfiguration](docs/V1DeviceAllocationConfiguration.md) + - [V1DeviceAllocationResult](docs/V1DeviceAllocationResult.md) + - [V1DeviceAttribute](docs/V1DeviceAttribute.md) + - [V1DeviceCapacity](docs/V1DeviceCapacity.md) + - [V1DeviceClaim](docs/V1DeviceClaim.md) + - [V1DeviceClaimConfiguration](docs/V1DeviceClaimConfiguration.md) + - [V1DeviceClass](docs/V1DeviceClass.md) + - [V1DeviceClassConfiguration](docs/V1DeviceClassConfiguration.md) + - [V1DeviceClassList](docs/V1DeviceClassList.md) + - [V1DeviceClassSpec](docs/V1DeviceClassSpec.md) + - [V1DeviceConstraint](docs/V1DeviceConstraint.md) + - [V1DeviceCounterConsumption](docs/V1DeviceCounterConsumption.md) + - [V1DeviceRequest](docs/V1DeviceRequest.md) + - [V1DeviceRequestAllocationResult](docs/V1DeviceRequestAllocationResult.md) + - [V1DeviceSelector](docs/V1DeviceSelector.md) + - [V1DeviceSubRequest](docs/V1DeviceSubRequest.md) + - [V1DeviceTaint](docs/V1DeviceTaint.md) + - [V1DeviceToleration](docs/V1DeviceToleration.md) + - [V1DownwardAPIProjection](docs/V1DownwardAPIProjection.md) + - [V1DownwardAPIVolumeFile](docs/V1DownwardAPIVolumeFile.md) + - [V1DownwardAPIVolumeSource](docs/V1DownwardAPIVolumeSource.md) + - [V1EmptyDirVolumeSource](docs/V1EmptyDirVolumeSource.md) + - [V1Endpoint](docs/V1Endpoint.md) + - [V1EndpointAddress](docs/V1EndpointAddress.md) + - [V1EndpointConditions](docs/V1EndpointConditions.md) + - [V1EndpointHints](docs/V1EndpointHints.md) + - [V1EndpointSlice](docs/V1EndpointSlice.md) + - [V1EndpointSliceList](docs/V1EndpointSliceList.md) + - [V1EndpointSubset](docs/V1EndpointSubset.md) + - [V1Endpoints](docs/V1Endpoints.md) + - [V1EndpointsList](docs/V1EndpointsList.md) + - [V1EnvFromSource](docs/V1EnvFromSource.md) + - [V1EnvVar](docs/V1EnvVar.md) + - [V1EnvVarSource](docs/V1EnvVarSource.md) + - [V1EphemeralContainer](docs/V1EphemeralContainer.md) + - [V1EphemeralVolumeSource](docs/V1EphemeralVolumeSource.md) + - [V1EventSource](docs/V1EventSource.md) + - [V1Eviction](docs/V1Eviction.md) + - [V1ExactDeviceRequest](docs/V1ExactDeviceRequest.md) + - [V1ExecAction](docs/V1ExecAction.md) + - [V1ExemptPriorityLevelConfiguration](docs/V1ExemptPriorityLevelConfiguration.md) + - [V1ExpressionWarning](docs/V1ExpressionWarning.md) + - [V1ExternalDocumentation](docs/V1ExternalDocumentation.md) + - [V1FCVolumeSource](docs/V1FCVolumeSource.md) + - [V1FieldSelectorAttributes](docs/V1FieldSelectorAttributes.md) + - [V1FieldSelectorRequirement](docs/V1FieldSelectorRequirement.md) + - [V1FileKeySelector](docs/V1FileKeySelector.md) + - [V1FlexPersistentVolumeSource](docs/V1FlexPersistentVolumeSource.md) + - [V1FlexVolumeSource](docs/V1FlexVolumeSource.md) + - [V1FlockerVolumeSource](docs/V1FlockerVolumeSource.md) + - [V1FlowDistinguisherMethod](docs/V1FlowDistinguisherMethod.md) + - [V1FlowSchema](docs/V1FlowSchema.md) + - [V1FlowSchemaCondition](docs/V1FlowSchemaCondition.md) + - [V1FlowSchemaList](docs/V1FlowSchemaList.md) + - [V1FlowSchemaSpec](docs/V1FlowSchemaSpec.md) + - [V1FlowSchemaStatus](docs/V1FlowSchemaStatus.md) + - [V1ForNode](docs/V1ForNode.md) + - [V1ForZone](docs/V1ForZone.md) + - [V1GCEPersistentDiskVolumeSource](docs/V1GCEPersistentDiskVolumeSource.md) + - [V1GRPCAction](docs/V1GRPCAction.md) + - [V1GitRepoVolumeSource](docs/V1GitRepoVolumeSource.md) + - [V1GlusterfsPersistentVolumeSource](docs/V1GlusterfsPersistentVolumeSource.md) + - [V1GlusterfsVolumeSource](docs/V1GlusterfsVolumeSource.md) + - [V1GroupResource](docs/V1GroupResource.md) + - [V1GroupSubject](docs/V1GroupSubject.md) + - [V1GroupVersionForDiscovery](docs/V1GroupVersionForDiscovery.md) + - [V1HTTPGetAction](docs/V1HTTPGetAction.md) + - [V1HTTPHeader](docs/V1HTTPHeader.md) + - [V1HTTPIngressPath](docs/V1HTTPIngressPath.md) + - [V1HTTPIngressRuleValue](docs/V1HTTPIngressRuleValue.md) + - [V1HorizontalPodAutoscaler](docs/V1HorizontalPodAutoscaler.md) + - [V1HorizontalPodAutoscalerList](docs/V1HorizontalPodAutoscalerList.md) + - [V1HorizontalPodAutoscalerSpec](docs/V1HorizontalPodAutoscalerSpec.md) + - [V1HorizontalPodAutoscalerStatus](docs/V1HorizontalPodAutoscalerStatus.md) + - [V1HostAlias](docs/V1HostAlias.md) + - [V1HostIP](docs/V1HostIP.md) + - [V1HostPathVolumeSource](docs/V1HostPathVolumeSource.md) + - [V1IPAddress](docs/V1IPAddress.md) + - [V1IPAddressList](docs/V1IPAddressList.md) + - [V1IPAddressSpec](docs/V1IPAddressSpec.md) + - [V1IPBlock](docs/V1IPBlock.md) + - [V1ISCSIPersistentVolumeSource](docs/V1ISCSIPersistentVolumeSource.md) + - [V1ISCSIVolumeSource](docs/V1ISCSIVolumeSource.md) + - [V1ImageVolumeSource](docs/V1ImageVolumeSource.md) + - [V1Ingress](docs/V1Ingress.md) + - [V1IngressBackend](docs/V1IngressBackend.md) + - [V1IngressClass](docs/V1IngressClass.md) + - [V1IngressClassList](docs/V1IngressClassList.md) + - [V1IngressClassParametersReference](docs/V1IngressClassParametersReference.md) + - [V1IngressClassSpec](docs/V1IngressClassSpec.md) + - [V1IngressList](docs/V1IngressList.md) + - [V1IngressLoadBalancerIngress](docs/V1IngressLoadBalancerIngress.md) + - [V1IngressLoadBalancerStatus](docs/V1IngressLoadBalancerStatus.md) + - [V1IngressPortStatus](docs/V1IngressPortStatus.md) + - [V1IngressRule](docs/V1IngressRule.md) + - [V1IngressServiceBackend](docs/V1IngressServiceBackend.md) + - [V1IngressSpec](docs/V1IngressSpec.md) + - [V1IngressStatus](docs/V1IngressStatus.md) + - [V1IngressTLS](docs/V1IngressTLS.md) + - [V1JSONSchemaProps](docs/V1JSONSchemaProps.md) + - [V1Job](docs/V1Job.md) + - [V1JobCondition](docs/V1JobCondition.md) + - [V1JobList](docs/V1JobList.md) + - [V1JobSpec](docs/V1JobSpec.md) + - [V1JobStatus](docs/V1JobStatus.md) + - [V1JobTemplateSpec](docs/V1JobTemplateSpec.md) + - [V1KeyToPath](docs/V1KeyToPath.md) + - [V1LabelSelector](docs/V1LabelSelector.md) + - [V1LabelSelectorAttributes](docs/V1LabelSelectorAttributes.md) + - [V1LabelSelectorRequirement](docs/V1LabelSelectorRequirement.md) + - [V1Lease](docs/V1Lease.md) + - [V1LeaseList](docs/V1LeaseList.md) + - [V1LeaseSpec](docs/V1LeaseSpec.md) + - [V1Lifecycle](docs/V1Lifecycle.md) + - [V1LifecycleHandler](docs/V1LifecycleHandler.md) + - [V1LimitRange](docs/V1LimitRange.md) + - [V1LimitRangeItem](docs/V1LimitRangeItem.md) + - [V1LimitRangeList](docs/V1LimitRangeList.md) + - [V1LimitRangeSpec](docs/V1LimitRangeSpec.md) + - [V1LimitResponse](docs/V1LimitResponse.md) + - [V1LimitedPriorityLevelConfiguration](docs/V1LimitedPriorityLevelConfiguration.md) + - [V1LinuxContainerUser](docs/V1LinuxContainerUser.md) + - [V1ListMeta](docs/V1ListMeta.md) + - [V1LoadBalancerIngress](docs/V1LoadBalancerIngress.md) + - [V1LoadBalancerStatus](docs/V1LoadBalancerStatus.md) + - [V1LocalObjectReference](docs/V1LocalObjectReference.md) + - [V1LocalSubjectAccessReview](docs/V1LocalSubjectAccessReview.md) + - [V1LocalVolumeSource](docs/V1LocalVolumeSource.md) + - [V1ManagedFieldsEntry](docs/V1ManagedFieldsEntry.md) + - [V1MatchCondition](docs/V1MatchCondition.md) + - [V1MatchResources](docs/V1MatchResources.md) + - [V1ModifyVolumeStatus](docs/V1ModifyVolumeStatus.md) + - [V1MutatingWebhook](docs/V1MutatingWebhook.md) + - [V1MutatingWebhookConfiguration](docs/V1MutatingWebhookConfiguration.md) + - [V1MutatingWebhookConfigurationList](docs/V1MutatingWebhookConfigurationList.md) + - [V1NFSVolumeSource](docs/V1NFSVolumeSource.md) + - [V1NamedRuleWithOperations](docs/V1NamedRuleWithOperations.md) + - [V1Namespace](docs/V1Namespace.md) + - [V1NamespaceCondition](docs/V1NamespaceCondition.md) + - [V1NamespaceList](docs/V1NamespaceList.md) + - [V1NamespaceSpec](docs/V1NamespaceSpec.md) + - [V1NamespaceStatus](docs/V1NamespaceStatus.md) + - [V1NetworkDeviceData](docs/V1NetworkDeviceData.md) + - [V1NetworkPolicy](docs/V1NetworkPolicy.md) + - [V1NetworkPolicyEgressRule](docs/V1NetworkPolicyEgressRule.md) + - [V1NetworkPolicyIngressRule](docs/V1NetworkPolicyIngressRule.md) + - [V1NetworkPolicyList](docs/V1NetworkPolicyList.md) + - [V1NetworkPolicyPeer](docs/V1NetworkPolicyPeer.md) + - [V1NetworkPolicyPort](docs/V1NetworkPolicyPort.md) + - [V1NetworkPolicySpec](docs/V1NetworkPolicySpec.md) + - [V1Node](docs/V1Node.md) + - [V1NodeAddress](docs/V1NodeAddress.md) + - [V1NodeAffinity](docs/V1NodeAffinity.md) + - [V1NodeCondition](docs/V1NodeCondition.md) + - [V1NodeConfigSource](docs/V1NodeConfigSource.md) + - [V1NodeConfigStatus](docs/V1NodeConfigStatus.md) + - [V1NodeDaemonEndpoints](docs/V1NodeDaemonEndpoints.md) + - [V1NodeFeatures](docs/V1NodeFeatures.md) + - [V1NodeList](docs/V1NodeList.md) + - [V1NodeRuntimeHandler](docs/V1NodeRuntimeHandler.md) + - [V1NodeRuntimeHandlerFeatures](docs/V1NodeRuntimeHandlerFeatures.md) + - [V1NodeSelector](docs/V1NodeSelector.md) + - [V1NodeSelectorRequirement](docs/V1NodeSelectorRequirement.md) + - [V1NodeSelectorTerm](docs/V1NodeSelectorTerm.md) + - [V1NodeSpec](docs/V1NodeSpec.md) + - [V1NodeStatus](docs/V1NodeStatus.md) + - [V1NodeSwapStatus](docs/V1NodeSwapStatus.md) + - [V1NodeSystemInfo](docs/V1NodeSystemInfo.md) + - [V1NonResourceAttributes](docs/V1NonResourceAttributes.md) + - [V1NonResourcePolicyRule](docs/V1NonResourcePolicyRule.md) + - [V1NonResourceRule](docs/V1NonResourceRule.md) + - [V1ObjectFieldSelector](docs/V1ObjectFieldSelector.md) + - [V1ObjectMeta](docs/V1ObjectMeta.md) + - [V1ObjectReference](docs/V1ObjectReference.md) + - [V1OpaqueDeviceConfiguration](docs/V1OpaqueDeviceConfiguration.md) + - [V1Overhead](docs/V1Overhead.md) + - [V1OwnerReference](docs/V1OwnerReference.md) + - [V1ParamKind](docs/V1ParamKind.md) + - [V1ParamRef](docs/V1ParamRef.md) + - [V1ParentReference](docs/V1ParentReference.md) + - [V1PersistentVolume](docs/V1PersistentVolume.md) + - [V1PersistentVolumeClaim](docs/V1PersistentVolumeClaim.md) + - [V1PersistentVolumeClaimCondition](docs/V1PersistentVolumeClaimCondition.md) + - [V1PersistentVolumeClaimList](docs/V1PersistentVolumeClaimList.md) + - [V1PersistentVolumeClaimSpec](docs/V1PersistentVolumeClaimSpec.md) + - [V1PersistentVolumeClaimStatus](docs/V1PersistentVolumeClaimStatus.md) + - [V1PersistentVolumeClaimTemplate](docs/V1PersistentVolumeClaimTemplate.md) + - [V1PersistentVolumeClaimVolumeSource](docs/V1PersistentVolumeClaimVolumeSource.md) + - [V1PersistentVolumeList](docs/V1PersistentVolumeList.md) + - [V1PersistentVolumeSpec](docs/V1PersistentVolumeSpec.md) + - [V1PersistentVolumeStatus](docs/V1PersistentVolumeStatus.md) + - [V1PhotonPersistentDiskVolumeSource](docs/V1PhotonPersistentDiskVolumeSource.md) + - [V1Pod](docs/V1Pod.md) + - [V1PodAffinity](docs/V1PodAffinity.md) + - [V1PodAffinityTerm](docs/V1PodAffinityTerm.md) + - [V1PodAntiAffinity](docs/V1PodAntiAffinity.md) + - [V1PodCertificateProjection](docs/V1PodCertificateProjection.md) + - [V1PodCondition](docs/V1PodCondition.md) + - [V1PodDNSConfig](docs/V1PodDNSConfig.md) + - [V1PodDNSConfigOption](docs/V1PodDNSConfigOption.md) + - [V1PodDisruptionBudget](docs/V1PodDisruptionBudget.md) + - [V1PodDisruptionBudgetList](docs/V1PodDisruptionBudgetList.md) + - [V1PodDisruptionBudgetSpec](docs/V1PodDisruptionBudgetSpec.md) + - [V1PodDisruptionBudgetStatus](docs/V1PodDisruptionBudgetStatus.md) + - [V1PodExtendedResourceClaimStatus](docs/V1PodExtendedResourceClaimStatus.md) + - [V1PodFailurePolicy](docs/V1PodFailurePolicy.md) + - [V1PodFailurePolicyOnExitCodesRequirement](docs/V1PodFailurePolicyOnExitCodesRequirement.md) + - [V1PodFailurePolicyOnPodConditionsPattern](docs/V1PodFailurePolicyOnPodConditionsPattern.md) + - [V1PodFailurePolicyRule](docs/V1PodFailurePolicyRule.md) + - [V1PodIP](docs/V1PodIP.md) + - [V1PodList](docs/V1PodList.md) + - [V1PodOS](docs/V1PodOS.md) + - [V1PodReadinessGate](docs/V1PodReadinessGate.md) + - [V1PodResourceClaim](docs/V1PodResourceClaim.md) + - [V1PodResourceClaimStatus](docs/V1PodResourceClaimStatus.md) + - [V1PodSchedulingGate](docs/V1PodSchedulingGate.md) + - [V1PodSecurityContext](docs/V1PodSecurityContext.md) + - [V1PodSpec](docs/V1PodSpec.md) + - [V1PodStatus](docs/V1PodStatus.md) + - [V1PodTemplate](docs/V1PodTemplate.md) + - [V1PodTemplateList](docs/V1PodTemplateList.md) + - [V1PodTemplateSpec](docs/V1PodTemplateSpec.md) + - [V1PolicyRule](docs/V1PolicyRule.md) + - [V1PolicyRulesWithSubjects](docs/V1PolicyRulesWithSubjects.md) + - [V1PortStatus](docs/V1PortStatus.md) + - [V1PortworxVolumeSource](docs/V1PortworxVolumeSource.md) + - [V1Preconditions](docs/V1Preconditions.md) + - [V1PreferredSchedulingTerm](docs/V1PreferredSchedulingTerm.md) + - [V1PriorityClass](docs/V1PriorityClass.md) + - [V1PriorityClassList](docs/V1PriorityClassList.md) + - [V1PriorityLevelConfiguration](docs/V1PriorityLevelConfiguration.md) + - [V1PriorityLevelConfigurationCondition](docs/V1PriorityLevelConfigurationCondition.md) + - [V1PriorityLevelConfigurationList](docs/V1PriorityLevelConfigurationList.md) + - [V1PriorityLevelConfigurationReference](docs/V1PriorityLevelConfigurationReference.md) + - [V1PriorityLevelConfigurationSpec](docs/V1PriorityLevelConfigurationSpec.md) + - [V1PriorityLevelConfigurationStatus](docs/V1PriorityLevelConfigurationStatus.md) + - [V1Probe](docs/V1Probe.md) + - [V1ProjectedVolumeSource](docs/V1ProjectedVolumeSource.md) + - [V1QueuingConfiguration](docs/V1QueuingConfiguration.md) + - [V1QuobyteVolumeSource](docs/V1QuobyteVolumeSource.md) + - [V1RBDPersistentVolumeSource](docs/V1RBDPersistentVolumeSource.md) + - [V1RBDVolumeSource](docs/V1RBDVolumeSource.md) + - [V1ReplicaSet](docs/V1ReplicaSet.md) + - [V1ReplicaSetCondition](docs/V1ReplicaSetCondition.md) + - [V1ReplicaSetList](docs/V1ReplicaSetList.md) + - [V1ReplicaSetSpec](docs/V1ReplicaSetSpec.md) + - [V1ReplicaSetStatus](docs/V1ReplicaSetStatus.md) + - [V1ReplicationController](docs/V1ReplicationController.md) + - [V1ReplicationControllerCondition](docs/V1ReplicationControllerCondition.md) + - [V1ReplicationControllerList](docs/V1ReplicationControllerList.md) + - [V1ReplicationControllerSpec](docs/V1ReplicationControllerSpec.md) + - [V1ReplicationControllerStatus](docs/V1ReplicationControllerStatus.md) + - [V1ResourceAttributes](docs/V1ResourceAttributes.md) + - [V1ResourceClaimConsumerReference](docs/V1ResourceClaimConsumerReference.md) + - [V1ResourceClaimList](docs/V1ResourceClaimList.md) + - [V1ResourceClaimSpec](docs/V1ResourceClaimSpec.md) + - [V1ResourceClaimStatus](docs/V1ResourceClaimStatus.md) + - [V1ResourceClaimTemplate](docs/V1ResourceClaimTemplate.md) + - [V1ResourceClaimTemplateList](docs/V1ResourceClaimTemplateList.md) + - [V1ResourceClaimTemplateSpec](docs/V1ResourceClaimTemplateSpec.md) + - [V1ResourceFieldSelector](docs/V1ResourceFieldSelector.md) + - [V1ResourceHealth](docs/V1ResourceHealth.md) + - [V1ResourcePolicyRule](docs/V1ResourcePolicyRule.md) + - [V1ResourcePool](docs/V1ResourcePool.md) + - [V1ResourceQuota](docs/V1ResourceQuota.md) + - [V1ResourceQuotaList](docs/V1ResourceQuotaList.md) + - [V1ResourceQuotaSpec](docs/V1ResourceQuotaSpec.md) + - [V1ResourceQuotaStatus](docs/V1ResourceQuotaStatus.md) + - [V1ResourceRequirements](docs/V1ResourceRequirements.md) + - [V1ResourceRule](docs/V1ResourceRule.md) + - [V1ResourceSlice](docs/V1ResourceSlice.md) + - [V1ResourceSliceList](docs/V1ResourceSliceList.md) + - [V1ResourceSliceSpec](docs/V1ResourceSliceSpec.md) + - [V1ResourceStatus](docs/V1ResourceStatus.md) + - [V1Role](docs/V1Role.md) + - [V1RoleBinding](docs/V1RoleBinding.md) + - [V1RoleBindingList](docs/V1RoleBindingList.md) + - [V1RoleList](docs/V1RoleList.md) + - [V1RoleRef](docs/V1RoleRef.md) + - [V1RollingUpdateDaemonSet](docs/V1RollingUpdateDaemonSet.md) + - [V1RollingUpdateDeployment](docs/V1RollingUpdateDeployment.md) + - [V1RollingUpdateStatefulSetStrategy](docs/V1RollingUpdateStatefulSetStrategy.md) + - [V1RuleWithOperations](docs/V1RuleWithOperations.md) + - [V1RuntimeClass](docs/V1RuntimeClass.md) + - [V1RuntimeClassList](docs/V1RuntimeClassList.md) + - [V1SELinuxOptions](docs/V1SELinuxOptions.md) + - [V1Scale](docs/V1Scale.md) + - [V1ScaleIOPersistentVolumeSource](docs/V1ScaleIOPersistentVolumeSource.md) + - [V1ScaleIOVolumeSource](docs/V1ScaleIOVolumeSource.md) + - [V1ScaleSpec](docs/V1ScaleSpec.md) + - [V1ScaleStatus](docs/V1ScaleStatus.md) + - [V1Scheduling](docs/V1Scheduling.md) + - [V1ScopeSelector](docs/V1ScopeSelector.md) + - [V1ScopedResourceSelectorRequirement](docs/V1ScopedResourceSelectorRequirement.md) + - [V1SeccompProfile](docs/V1SeccompProfile.md) + - [V1Secret](docs/V1Secret.md) + - [V1SecretEnvSource](docs/V1SecretEnvSource.md) + - [V1SecretKeySelector](docs/V1SecretKeySelector.md) + - [V1SecretList](docs/V1SecretList.md) + - [V1SecretProjection](docs/V1SecretProjection.md) + - [V1SecretReference](docs/V1SecretReference.md) + - [V1SecretVolumeSource](docs/V1SecretVolumeSource.md) + - [V1SecurityContext](docs/V1SecurityContext.md) + - [V1SelectableField](docs/V1SelectableField.md) + - [V1SelfSubjectAccessReview](docs/V1SelfSubjectAccessReview.md) + - [V1SelfSubjectAccessReviewSpec](docs/V1SelfSubjectAccessReviewSpec.md) + - [V1SelfSubjectReview](docs/V1SelfSubjectReview.md) + - [V1SelfSubjectReviewStatus](docs/V1SelfSubjectReviewStatus.md) + - [V1SelfSubjectRulesReview](docs/V1SelfSubjectRulesReview.md) + - [V1SelfSubjectRulesReviewSpec](docs/V1SelfSubjectRulesReviewSpec.md) + - [V1ServerAddressByClientCIDR](docs/V1ServerAddressByClientCIDR.md) + - [V1Service](docs/V1Service.md) + - [V1ServiceAccount](docs/V1ServiceAccount.md) + - [V1ServiceAccountList](docs/V1ServiceAccountList.md) + - [V1ServiceAccountSubject](docs/V1ServiceAccountSubject.md) + - [V1ServiceAccountTokenProjection](docs/V1ServiceAccountTokenProjection.md) + - [V1ServiceBackendPort](docs/V1ServiceBackendPort.md) + - [V1ServiceCIDR](docs/V1ServiceCIDR.md) + - [V1ServiceCIDRList](docs/V1ServiceCIDRList.md) + - [V1ServiceCIDRSpec](docs/V1ServiceCIDRSpec.md) + - [V1ServiceCIDRStatus](docs/V1ServiceCIDRStatus.md) + - [V1ServiceList](docs/V1ServiceList.md) + - [V1ServicePort](docs/V1ServicePort.md) + - [V1ServiceSpec](docs/V1ServiceSpec.md) + - [V1ServiceStatus](docs/V1ServiceStatus.md) + - [V1SessionAffinityConfig](docs/V1SessionAffinityConfig.md) + - [V1SleepAction](docs/V1SleepAction.md) + - [V1StatefulSet](docs/V1StatefulSet.md) + - [V1StatefulSetCondition](docs/V1StatefulSetCondition.md) + - [V1StatefulSetList](docs/V1StatefulSetList.md) + - [V1StatefulSetOrdinals](docs/V1StatefulSetOrdinals.md) + - [V1StatefulSetPersistentVolumeClaimRetentionPolicy](docs/V1StatefulSetPersistentVolumeClaimRetentionPolicy.md) + - [V1StatefulSetSpec](docs/V1StatefulSetSpec.md) + - [V1StatefulSetStatus](docs/V1StatefulSetStatus.md) + - [V1StatefulSetUpdateStrategy](docs/V1StatefulSetUpdateStrategy.md) + - [V1Status](docs/V1Status.md) + - [V1StatusCause](docs/V1StatusCause.md) + - [V1StatusDetails](docs/V1StatusDetails.md) + - [V1StorageClass](docs/V1StorageClass.md) + - [V1StorageClassList](docs/V1StorageClassList.md) + - [V1StorageOSPersistentVolumeSource](docs/V1StorageOSPersistentVolumeSource.md) + - [V1StorageOSVolumeSource](docs/V1StorageOSVolumeSource.md) + - [V1SubjectAccessReview](docs/V1SubjectAccessReview.md) + - [V1SubjectAccessReviewSpec](docs/V1SubjectAccessReviewSpec.md) + - [V1SubjectAccessReviewStatus](docs/V1SubjectAccessReviewStatus.md) + - [V1SubjectRulesReviewStatus](docs/V1SubjectRulesReviewStatus.md) + - [V1SuccessPolicy](docs/V1SuccessPolicy.md) + - [V1SuccessPolicyRule](docs/V1SuccessPolicyRule.md) + - [V1Sysctl](docs/V1Sysctl.md) + - [V1TCPSocketAction](docs/V1TCPSocketAction.md) + - [V1Taint](docs/V1Taint.md) + - [V1TokenRequestSpec](docs/V1TokenRequestSpec.md) + - [V1TokenRequestStatus](docs/V1TokenRequestStatus.md) + - [V1TokenReview](docs/V1TokenReview.md) + - [V1TokenReviewSpec](docs/V1TokenReviewSpec.md) + - [V1TokenReviewStatus](docs/V1TokenReviewStatus.md) + - [V1Toleration](docs/V1Toleration.md) + - [V1TopologySelectorLabelRequirement](docs/V1TopologySelectorLabelRequirement.md) + - [V1TopologySelectorTerm](docs/V1TopologySelectorTerm.md) + - [V1TopologySpreadConstraint](docs/V1TopologySpreadConstraint.md) + - [V1TypeChecking](docs/V1TypeChecking.md) + - [V1TypedLocalObjectReference](docs/V1TypedLocalObjectReference.md) + - [V1TypedObjectReference](docs/V1TypedObjectReference.md) + - [V1UncountedTerminatedPods](docs/V1UncountedTerminatedPods.md) + - [V1UserInfo](docs/V1UserInfo.md) + - [V1UserSubject](docs/V1UserSubject.md) + - [V1ValidatingAdmissionPolicy](docs/V1ValidatingAdmissionPolicy.md) + - [V1ValidatingAdmissionPolicyBinding](docs/V1ValidatingAdmissionPolicyBinding.md) + - [V1ValidatingAdmissionPolicyBindingList](docs/V1ValidatingAdmissionPolicyBindingList.md) + - [V1ValidatingAdmissionPolicyBindingSpec](docs/V1ValidatingAdmissionPolicyBindingSpec.md) + - [V1ValidatingAdmissionPolicyList](docs/V1ValidatingAdmissionPolicyList.md) + - [V1ValidatingAdmissionPolicySpec](docs/V1ValidatingAdmissionPolicySpec.md) + - [V1ValidatingAdmissionPolicyStatus](docs/V1ValidatingAdmissionPolicyStatus.md) + - [V1ValidatingWebhook](docs/V1ValidatingWebhook.md) + - [V1ValidatingWebhookConfiguration](docs/V1ValidatingWebhookConfiguration.md) + - [V1ValidatingWebhookConfigurationList](docs/V1ValidatingWebhookConfigurationList.md) + - [V1Validation](docs/V1Validation.md) + - [V1ValidationRule](docs/V1ValidationRule.md) + - [V1Variable](docs/V1Variable.md) + - [V1Volume](docs/V1Volume.md) + - [V1VolumeAttachment](docs/V1VolumeAttachment.md) + - [V1VolumeAttachmentList](docs/V1VolumeAttachmentList.md) + - [V1VolumeAttachmentSource](docs/V1VolumeAttachmentSource.md) + - [V1VolumeAttachmentSpec](docs/V1VolumeAttachmentSpec.md) + - [V1VolumeAttachmentStatus](docs/V1VolumeAttachmentStatus.md) + - [V1VolumeAttributesClass](docs/V1VolumeAttributesClass.md) + - [V1VolumeAttributesClassList](docs/V1VolumeAttributesClassList.md) + - [V1VolumeDevice](docs/V1VolumeDevice.md) + - [V1VolumeError](docs/V1VolumeError.md) + - [V1VolumeMount](docs/V1VolumeMount.md) + - [V1VolumeMountStatus](docs/V1VolumeMountStatus.md) + - [V1VolumeNodeAffinity](docs/V1VolumeNodeAffinity.md) + - [V1VolumeNodeResources](docs/V1VolumeNodeResources.md) + - [V1VolumeProjection](docs/V1VolumeProjection.md) + - [V1VolumeResourceRequirements](docs/V1VolumeResourceRequirements.md) + - [V1VsphereVirtualDiskVolumeSource](docs/V1VsphereVirtualDiskVolumeSource.md) + - [V1WatchEvent](docs/V1WatchEvent.md) + - [V1WebhookConversion](docs/V1WebhookConversion.md) + - [V1WeightedPodAffinityTerm](docs/V1WeightedPodAffinityTerm.md) + - [V1WindowsSecurityContextOptions](docs/V1WindowsSecurityContextOptions.md) + - [V1WorkloadReference](docs/V1WorkloadReference.md) + - [V1alpha1ApplyConfiguration](docs/V1alpha1ApplyConfiguration.md) + - [V1alpha1ClusterTrustBundle](docs/V1alpha1ClusterTrustBundle.md) + - [V1alpha1ClusterTrustBundleList](docs/V1alpha1ClusterTrustBundleList.md) + - [V1alpha1ClusterTrustBundleSpec](docs/V1alpha1ClusterTrustBundleSpec.md) + - [V1alpha1GangSchedulingPolicy](docs/V1alpha1GangSchedulingPolicy.md) + - [V1alpha1JSONPatch](docs/V1alpha1JSONPatch.md) + - [V1alpha1MatchCondition](docs/V1alpha1MatchCondition.md) + - [V1alpha1MatchResources](docs/V1alpha1MatchResources.md) + - [V1alpha1MutatingAdmissionPolicy](docs/V1alpha1MutatingAdmissionPolicy.md) + - [V1alpha1MutatingAdmissionPolicyBinding](docs/V1alpha1MutatingAdmissionPolicyBinding.md) + - [V1alpha1MutatingAdmissionPolicyBindingList](docs/V1alpha1MutatingAdmissionPolicyBindingList.md) + - [V1alpha1MutatingAdmissionPolicyBindingSpec](docs/V1alpha1MutatingAdmissionPolicyBindingSpec.md) + - [V1alpha1MutatingAdmissionPolicyList](docs/V1alpha1MutatingAdmissionPolicyList.md) + - [V1alpha1MutatingAdmissionPolicySpec](docs/V1alpha1MutatingAdmissionPolicySpec.md) + - [V1alpha1Mutation](docs/V1alpha1Mutation.md) + - [V1alpha1NamedRuleWithOperations](docs/V1alpha1NamedRuleWithOperations.md) + - [V1alpha1ParamKind](docs/V1alpha1ParamKind.md) + - [V1alpha1ParamRef](docs/V1alpha1ParamRef.md) + - [V1alpha1PodGroup](docs/V1alpha1PodGroup.md) + - [V1alpha1PodGroupPolicy](docs/V1alpha1PodGroupPolicy.md) + - [V1alpha1ServerStorageVersion](docs/V1alpha1ServerStorageVersion.md) + - [V1alpha1StorageVersion](docs/V1alpha1StorageVersion.md) + - [V1alpha1StorageVersionCondition](docs/V1alpha1StorageVersionCondition.md) + - [V1alpha1StorageVersionList](docs/V1alpha1StorageVersionList.md) + - [V1alpha1StorageVersionStatus](docs/V1alpha1StorageVersionStatus.md) + - [V1alpha1TypedLocalObjectReference](docs/V1alpha1TypedLocalObjectReference.md) + - [V1alpha1Variable](docs/V1alpha1Variable.md) + - [V1alpha1Workload](docs/V1alpha1Workload.md) + - [V1alpha1WorkloadList](docs/V1alpha1WorkloadList.md) + - [V1alpha1WorkloadSpec](docs/V1alpha1WorkloadSpec.md) + - [V1alpha2LeaseCandidate](docs/V1alpha2LeaseCandidate.md) + - [V1alpha2LeaseCandidateList](docs/V1alpha2LeaseCandidateList.md) + - [V1alpha2LeaseCandidateSpec](docs/V1alpha2LeaseCandidateSpec.md) + - [V1alpha3DeviceTaint](docs/V1alpha3DeviceTaint.md) + - [V1alpha3DeviceTaintRule](docs/V1alpha3DeviceTaintRule.md) + - [V1alpha3DeviceTaintRuleList](docs/V1alpha3DeviceTaintRuleList.md) + - [V1alpha3DeviceTaintRuleSpec](docs/V1alpha3DeviceTaintRuleSpec.md) + - [V1alpha3DeviceTaintRuleStatus](docs/V1alpha3DeviceTaintRuleStatus.md) + - [V1alpha3DeviceTaintSelector](docs/V1alpha3DeviceTaintSelector.md) + - [V1beta1AllocatedDeviceStatus](docs/V1beta1AllocatedDeviceStatus.md) + - [V1beta1AllocationResult](docs/V1beta1AllocationResult.md) + - [V1beta1ApplyConfiguration](docs/V1beta1ApplyConfiguration.md) + - [V1beta1BasicDevice](docs/V1beta1BasicDevice.md) + - [V1beta1CELDeviceSelector](docs/V1beta1CELDeviceSelector.md) + - [V1beta1CapacityRequestPolicy](docs/V1beta1CapacityRequestPolicy.md) + - [V1beta1CapacityRequestPolicyRange](docs/V1beta1CapacityRequestPolicyRange.md) + - [V1beta1CapacityRequirements](docs/V1beta1CapacityRequirements.md) + - [V1beta1ClusterTrustBundle](docs/V1beta1ClusterTrustBundle.md) + - [V1beta1ClusterTrustBundleList](docs/V1beta1ClusterTrustBundleList.md) + - [V1beta1ClusterTrustBundleSpec](docs/V1beta1ClusterTrustBundleSpec.md) + - [V1beta1Counter](docs/V1beta1Counter.md) + - [V1beta1CounterSet](docs/V1beta1CounterSet.md) + - [V1beta1Device](docs/V1beta1Device.md) + - [V1beta1DeviceAllocationConfiguration](docs/V1beta1DeviceAllocationConfiguration.md) + - [V1beta1DeviceAllocationResult](docs/V1beta1DeviceAllocationResult.md) + - [V1beta1DeviceAttribute](docs/V1beta1DeviceAttribute.md) + - [V1beta1DeviceCapacity](docs/V1beta1DeviceCapacity.md) + - [V1beta1DeviceClaim](docs/V1beta1DeviceClaim.md) + - [V1beta1DeviceClaimConfiguration](docs/V1beta1DeviceClaimConfiguration.md) + - [V1beta1DeviceClass](docs/V1beta1DeviceClass.md) + - [V1beta1DeviceClassConfiguration](docs/V1beta1DeviceClassConfiguration.md) + - [V1beta1DeviceClassList](docs/V1beta1DeviceClassList.md) + - [V1beta1DeviceClassSpec](docs/V1beta1DeviceClassSpec.md) + - [V1beta1DeviceConstraint](docs/V1beta1DeviceConstraint.md) + - [V1beta1DeviceCounterConsumption](docs/V1beta1DeviceCounterConsumption.md) + - [V1beta1DeviceRequest](docs/V1beta1DeviceRequest.md) + - [V1beta1DeviceRequestAllocationResult](docs/V1beta1DeviceRequestAllocationResult.md) + - [V1beta1DeviceSelector](docs/V1beta1DeviceSelector.md) + - [V1beta1DeviceSubRequest](docs/V1beta1DeviceSubRequest.md) + - [V1beta1DeviceTaint](docs/V1beta1DeviceTaint.md) + - [V1beta1DeviceToleration](docs/V1beta1DeviceToleration.md) + - [V1beta1IPAddress](docs/V1beta1IPAddress.md) + - [V1beta1IPAddressList](docs/V1beta1IPAddressList.md) + - [V1beta1IPAddressSpec](docs/V1beta1IPAddressSpec.md) + - [V1beta1JSONPatch](docs/V1beta1JSONPatch.md) + - [V1beta1LeaseCandidate](docs/V1beta1LeaseCandidate.md) + - [V1beta1LeaseCandidateList](docs/V1beta1LeaseCandidateList.md) + - [V1beta1LeaseCandidateSpec](docs/V1beta1LeaseCandidateSpec.md) + - [V1beta1MatchCondition](docs/V1beta1MatchCondition.md) + - [V1beta1MatchResources](docs/V1beta1MatchResources.md) + - [V1beta1MutatingAdmissionPolicy](docs/V1beta1MutatingAdmissionPolicy.md) + - [V1beta1MutatingAdmissionPolicyBinding](docs/V1beta1MutatingAdmissionPolicyBinding.md) + - [V1beta1MutatingAdmissionPolicyBindingList](docs/V1beta1MutatingAdmissionPolicyBindingList.md) + - [V1beta1MutatingAdmissionPolicyBindingSpec](docs/V1beta1MutatingAdmissionPolicyBindingSpec.md) + - [V1beta1MutatingAdmissionPolicyList](docs/V1beta1MutatingAdmissionPolicyList.md) + - [V1beta1MutatingAdmissionPolicySpec](docs/V1beta1MutatingAdmissionPolicySpec.md) + - [V1beta1Mutation](docs/V1beta1Mutation.md) + - [V1beta1NamedRuleWithOperations](docs/V1beta1NamedRuleWithOperations.md) + - [V1beta1NetworkDeviceData](docs/V1beta1NetworkDeviceData.md) + - [V1beta1OpaqueDeviceConfiguration](docs/V1beta1OpaqueDeviceConfiguration.md) + - [V1beta1ParamKind](docs/V1beta1ParamKind.md) + - [V1beta1ParamRef](docs/V1beta1ParamRef.md) + - [V1beta1ParentReference](docs/V1beta1ParentReference.md) + - [V1beta1PodCertificateRequest](docs/V1beta1PodCertificateRequest.md) + - [V1beta1PodCertificateRequestList](docs/V1beta1PodCertificateRequestList.md) + - [V1beta1PodCertificateRequestSpec](docs/V1beta1PodCertificateRequestSpec.md) + - [V1beta1PodCertificateRequestStatus](docs/V1beta1PodCertificateRequestStatus.md) + - [V1beta1ResourceClaim](docs/V1beta1ResourceClaim.md) + - [V1beta1ResourceClaimConsumerReference](docs/V1beta1ResourceClaimConsumerReference.md) + - [V1beta1ResourceClaimList](docs/V1beta1ResourceClaimList.md) + - [V1beta1ResourceClaimSpec](docs/V1beta1ResourceClaimSpec.md) + - [V1beta1ResourceClaimStatus](docs/V1beta1ResourceClaimStatus.md) + - [V1beta1ResourceClaimTemplate](docs/V1beta1ResourceClaimTemplate.md) + - [V1beta1ResourceClaimTemplateList](docs/V1beta1ResourceClaimTemplateList.md) + - [V1beta1ResourceClaimTemplateSpec](docs/V1beta1ResourceClaimTemplateSpec.md) + - [V1beta1ResourcePool](docs/V1beta1ResourcePool.md) + - [V1beta1ResourceSlice](docs/V1beta1ResourceSlice.md) + - [V1beta1ResourceSliceList](docs/V1beta1ResourceSliceList.md) + - [V1beta1ResourceSliceSpec](docs/V1beta1ResourceSliceSpec.md) + - [V1beta1ServiceCIDR](docs/V1beta1ServiceCIDR.md) + - [V1beta1ServiceCIDRList](docs/V1beta1ServiceCIDRList.md) + - [V1beta1ServiceCIDRSpec](docs/V1beta1ServiceCIDRSpec.md) + - [V1beta1ServiceCIDRStatus](docs/V1beta1ServiceCIDRStatus.md) + - [V1beta1StorageVersionMigration](docs/V1beta1StorageVersionMigration.md) + - [V1beta1StorageVersionMigrationList](docs/V1beta1StorageVersionMigrationList.md) + - [V1beta1StorageVersionMigrationSpec](docs/V1beta1StorageVersionMigrationSpec.md) + - [V1beta1StorageVersionMigrationStatus](docs/V1beta1StorageVersionMigrationStatus.md) + - [V1beta1Variable](docs/V1beta1Variable.md) + - [V1beta1VolumeAttributesClass](docs/V1beta1VolumeAttributesClass.md) + - [V1beta1VolumeAttributesClassList](docs/V1beta1VolumeAttributesClassList.md) + - [V1beta2AllocatedDeviceStatus](docs/V1beta2AllocatedDeviceStatus.md) + - [V1beta2AllocationResult](docs/V1beta2AllocationResult.md) + - [V1beta2CELDeviceSelector](docs/V1beta2CELDeviceSelector.md) + - [V1beta2CapacityRequestPolicy](docs/V1beta2CapacityRequestPolicy.md) + - [V1beta2CapacityRequestPolicyRange](docs/V1beta2CapacityRequestPolicyRange.md) + - [V1beta2CapacityRequirements](docs/V1beta2CapacityRequirements.md) + - [V1beta2Counter](docs/V1beta2Counter.md) + - [V1beta2CounterSet](docs/V1beta2CounterSet.md) + - [V1beta2Device](docs/V1beta2Device.md) + - [V1beta2DeviceAllocationConfiguration](docs/V1beta2DeviceAllocationConfiguration.md) + - [V1beta2DeviceAllocationResult](docs/V1beta2DeviceAllocationResult.md) + - [V1beta2DeviceAttribute](docs/V1beta2DeviceAttribute.md) + - [V1beta2DeviceCapacity](docs/V1beta2DeviceCapacity.md) + - [V1beta2DeviceClaim](docs/V1beta2DeviceClaim.md) + - [V1beta2DeviceClaimConfiguration](docs/V1beta2DeviceClaimConfiguration.md) + - [V1beta2DeviceClass](docs/V1beta2DeviceClass.md) + - [V1beta2DeviceClassConfiguration](docs/V1beta2DeviceClassConfiguration.md) + - [V1beta2DeviceClassList](docs/V1beta2DeviceClassList.md) + - [V1beta2DeviceClassSpec](docs/V1beta2DeviceClassSpec.md) + - [V1beta2DeviceConstraint](docs/V1beta2DeviceConstraint.md) + - [V1beta2DeviceCounterConsumption](docs/V1beta2DeviceCounterConsumption.md) + - [V1beta2DeviceRequest](docs/V1beta2DeviceRequest.md) + - [V1beta2DeviceRequestAllocationResult](docs/V1beta2DeviceRequestAllocationResult.md) + - [V1beta2DeviceSelector](docs/V1beta2DeviceSelector.md) + - [V1beta2DeviceSubRequest](docs/V1beta2DeviceSubRequest.md) + - [V1beta2DeviceTaint](docs/V1beta2DeviceTaint.md) + - [V1beta2DeviceToleration](docs/V1beta2DeviceToleration.md) + - [V1beta2ExactDeviceRequest](docs/V1beta2ExactDeviceRequest.md) + - [V1beta2NetworkDeviceData](docs/V1beta2NetworkDeviceData.md) + - [V1beta2OpaqueDeviceConfiguration](docs/V1beta2OpaqueDeviceConfiguration.md) + - [V1beta2ResourceClaim](docs/V1beta2ResourceClaim.md) + - [V1beta2ResourceClaimConsumerReference](docs/V1beta2ResourceClaimConsumerReference.md) + - [V1beta2ResourceClaimList](docs/V1beta2ResourceClaimList.md) + - [V1beta2ResourceClaimSpec](docs/V1beta2ResourceClaimSpec.md) + - [V1beta2ResourceClaimStatus](docs/V1beta2ResourceClaimStatus.md) + - [V1beta2ResourceClaimTemplate](docs/V1beta2ResourceClaimTemplate.md) + - [V1beta2ResourceClaimTemplateList](docs/V1beta2ResourceClaimTemplateList.md) + - [V1beta2ResourceClaimTemplateSpec](docs/V1beta2ResourceClaimTemplateSpec.md) + - [V1beta2ResourcePool](docs/V1beta2ResourcePool.md) + - [V1beta2ResourceSlice](docs/V1beta2ResourceSlice.md) + - [V1beta2ResourceSliceList](docs/V1beta2ResourceSliceList.md) + - [V1beta2ResourceSliceSpec](docs/V1beta2ResourceSliceSpec.md) + - [V2APIGroupDiscovery](docs/V2APIGroupDiscovery.md) + - [V2APIGroupDiscoveryList](docs/V2APIGroupDiscoveryList.md) + - [V2APIResourceDiscovery](docs/V2APIResourceDiscovery.md) + - [V2APISubresourceDiscovery](docs/V2APISubresourceDiscovery.md) + - [V2APIVersionDiscovery](docs/V2APIVersionDiscovery.md) + - [V2ContainerResourceMetricSource](docs/V2ContainerResourceMetricSource.md) + - [V2ContainerResourceMetricStatus](docs/V2ContainerResourceMetricStatus.md) + - [V2CrossVersionObjectReference](docs/V2CrossVersionObjectReference.md) + - [V2ExternalMetricSource](docs/V2ExternalMetricSource.md) + - [V2ExternalMetricStatus](docs/V2ExternalMetricStatus.md) + - [V2HPAScalingPolicy](docs/V2HPAScalingPolicy.md) + - [V2HPAScalingRules](docs/V2HPAScalingRules.md) + - [V2HorizontalPodAutoscaler](docs/V2HorizontalPodAutoscaler.md) + - [V2HorizontalPodAutoscalerBehavior](docs/V2HorizontalPodAutoscalerBehavior.md) + - [V2HorizontalPodAutoscalerCondition](docs/V2HorizontalPodAutoscalerCondition.md) + - [V2HorizontalPodAutoscalerList](docs/V2HorizontalPodAutoscalerList.md) + - [V2HorizontalPodAutoscalerSpec](docs/V2HorizontalPodAutoscalerSpec.md) + - [V2HorizontalPodAutoscalerStatus](docs/V2HorizontalPodAutoscalerStatus.md) + - [V2MetricIdentifier](docs/V2MetricIdentifier.md) + - [V2MetricSpec](docs/V2MetricSpec.md) + - [V2MetricStatus](docs/V2MetricStatus.md) + - [V2MetricTarget](docs/V2MetricTarget.md) + - [V2MetricValueStatus](docs/V2MetricValueStatus.md) + - [V2ObjectMetricSource](docs/V2ObjectMetricSource.md) + - [V2ObjectMetricStatus](docs/V2ObjectMetricStatus.md) + - [V2PodsMetricSource](docs/V2PodsMetricSource.md) + - [V2PodsMetricStatus](docs/V2PodsMetricStatus.md) + - [V2ResourceMetricSource](docs/V2ResourceMetricSource.md) + - [V2ResourceMetricStatus](docs/V2ResourceMetricStatus.md) + - [V2beta1APIGroupDiscovery](docs/V2beta1APIGroupDiscovery.md) + - [V2beta1APIGroupDiscoveryList](docs/V2beta1APIGroupDiscoveryList.md) + - [V2beta1APIResourceDiscovery](docs/V2beta1APIResourceDiscovery.md) + - [V2beta1APISubresourceDiscovery](docs/V2beta1APISubresourceDiscovery.md) + - [V2beta1APIVersionDiscovery](docs/V2beta1APIVersionDiscovery.md) + - [VersionInfo](docs/VersionInfo.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerToken + +- **Type**: API key +- **API key parameter name**: authorization +- **Location**: HTTP header + + +## Author + + + + diff --git a/kubernetes_asyncio/__init__.py b/kubernetes_asyncio/__init__.py new file mode 100644 index 0000000000..2ddf0e832c --- /dev/null +++ b/kubernetes_asyncio/__init__.py @@ -0,0 +1,21 @@ +# Copyright 2026 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__project__ = "kubernetes_asyncio" +# The version is auto-updated. Please do not edit. +__version__ = "35.0.0+snapshot" + +import kubernetes_asyncio.client as client + +__all__ = ["client"] diff --git a/kubernetes_asyncio/client/__init__.py b/kubernetes_asyncio/client/__init__.py new file mode 100644 index 0000000000..b63e0fd0a7 --- /dev/null +++ b/kubernetes_asyncio/client/__init__.py @@ -0,0 +1,827 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +__version__ = "35.0.0+snapshot" + +# import apis into sdk package +from kubernetes_asyncio.client.api.well_known_api import WellKnownApi +from kubernetes_asyncio.client.api.admissionregistration_api import AdmissionregistrationApi +from kubernetes_asyncio.client.api.admissionregistration_v1_api import AdmissionregistrationV1Api +from kubernetes_asyncio.client.api.admissionregistration_v1alpha1_api import AdmissionregistrationV1alpha1Api +from kubernetes_asyncio.client.api.admissionregistration_v1beta1_api import AdmissionregistrationV1beta1Api +from kubernetes_asyncio.client.api.apiextensions_api import ApiextensionsApi +from kubernetes_asyncio.client.api.apiextensions_v1_api import ApiextensionsV1Api +from kubernetes_asyncio.client.api.apiregistration_api import ApiregistrationApi +from kubernetes_asyncio.client.api.apiregistration_v1_api import ApiregistrationV1Api +from kubernetes_asyncio.client.api.apis_api import ApisApi +from kubernetes_asyncio.client.api.apps_api import AppsApi +from kubernetes_asyncio.client.api.apps_v1_api import AppsV1Api +from kubernetes_asyncio.client.api.authentication_api import AuthenticationApi +from kubernetes_asyncio.client.api.authentication_v1_api import AuthenticationV1Api +from kubernetes_asyncio.client.api.authorization_api import AuthorizationApi +from kubernetes_asyncio.client.api.authorization_v1_api import AuthorizationV1Api +from kubernetes_asyncio.client.api.autoscaling_api import AutoscalingApi +from kubernetes_asyncio.client.api.autoscaling_v1_api import AutoscalingV1Api +from kubernetes_asyncio.client.api.autoscaling_v2_api import AutoscalingV2Api +from kubernetes_asyncio.client.api.batch_api import BatchApi +from kubernetes_asyncio.client.api.batch_v1_api import BatchV1Api +from kubernetes_asyncio.client.api.certificates_api import CertificatesApi +from kubernetes_asyncio.client.api.certificates_v1_api import CertificatesV1Api +from kubernetes_asyncio.client.api.certificates_v1alpha1_api import CertificatesV1alpha1Api +from kubernetes_asyncio.client.api.certificates_v1beta1_api import CertificatesV1beta1Api +from kubernetes_asyncio.client.api.coordination_api import CoordinationApi +from kubernetes_asyncio.client.api.coordination_v1_api import CoordinationV1Api +from kubernetes_asyncio.client.api.coordination_v1alpha2_api import CoordinationV1alpha2Api +from kubernetes_asyncio.client.api.coordination_v1beta1_api import CoordinationV1beta1Api +from kubernetes_asyncio.client.api.core_api import CoreApi +from kubernetes_asyncio.client.api.core_v1_api import CoreV1Api +from kubernetes_asyncio.client.api.custom_objects_api import CustomObjectsApi +from kubernetes_asyncio.client.api.discovery_api import DiscoveryApi +from kubernetes_asyncio.client.api.discovery_v1_api import DiscoveryV1Api +from kubernetes_asyncio.client.api.events_api import EventsApi +from kubernetes_asyncio.client.api.events_v1_api import EventsV1Api +from kubernetes_asyncio.client.api.flowcontrol_apiserver_api import FlowcontrolApiserverApi +from kubernetes_asyncio.client.api.flowcontrol_apiserver_v1_api import FlowcontrolApiserverV1Api +from kubernetes_asyncio.client.api.internal_apiserver_api import InternalApiserverApi +from kubernetes_asyncio.client.api.internal_apiserver_v1alpha1_api import InternalApiserverV1alpha1Api +from kubernetes_asyncio.client.api.logs_api import LogsApi +from kubernetes_asyncio.client.api.networking_api import NetworkingApi +from kubernetes_asyncio.client.api.networking_v1_api import NetworkingV1Api +from kubernetes_asyncio.client.api.networking_v1beta1_api import NetworkingV1beta1Api +from kubernetes_asyncio.client.api.node_api import NodeApi +from kubernetes_asyncio.client.api.node_v1_api import NodeV1Api +from kubernetes_asyncio.client.api.openid_api import OpenidApi +from kubernetes_asyncio.client.api.policy_api import PolicyApi +from kubernetes_asyncio.client.api.policy_v1_api import PolicyV1Api +from kubernetes_asyncio.client.api.rbac_authorization_api import RbacAuthorizationApi +from kubernetes_asyncio.client.api.rbac_authorization_v1_api import RbacAuthorizationV1Api +from kubernetes_asyncio.client.api.resource_api import ResourceApi +from kubernetes_asyncio.client.api.resource_v1_api import ResourceV1Api +from kubernetes_asyncio.client.api.resource_v1alpha3_api import ResourceV1alpha3Api +from kubernetes_asyncio.client.api.resource_v1beta1_api import ResourceV1beta1Api +from kubernetes_asyncio.client.api.resource_v1beta2_api import ResourceV1beta2Api +from kubernetes_asyncio.client.api.scheduling_api import SchedulingApi +from kubernetes_asyncio.client.api.scheduling_v1_api import SchedulingV1Api +from kubernetes_asyncio.client.api.scheduling_v1alpha1_api import SchedulingV1alpha1Api +from kubernetes_asyncio.client.api.storage_api import StorageApi +from kubernetes_asyncio.client.api.storage_v1_api import StorageV1Api +from kubernetes_asyncio.client.api.storage_v1beta1_api import StorageV1beta1Api +from kubernetes_asyncio.client.api.storagemigration_api import StoragemigrationApi +from kubernetes_asyncio.client.api.storagemigration_v1beta1_api import StoragemigrationV1beta1Api +from kubernetes_asyncio.client.api.version_api import VersionApi + +# import ApiClient +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.configuration import Configuration +from kubernetes_asyncio.client.exceptions import OpenApiException +from kubernetes_asyncio.client.exceptions import ApiTypeError +from kubernetes_asyncio.client.exceptions import ApiValueError +from kubernetes_asyncio.client.exceptions import ApiKeyError +from kubernetes_asyncio.client.exceptions import ApiAttributeError +from kubernetes_asyncio.client.exceptions import ApiException +# import models into sdk package +from kubernetes_asyncio.client.models.admissionregistration_v1_service_reference import AdmissionregistrationV1ServiceReference +from kubernetes_asyncio.client.models.admissionregistration_v1_webhook_client_config import AdmissionregistrationV1WebhookClientConfig +from kubernetes_asyncio.client.models.apiextensions_v1_service_reference import ApiextensionsV1ServiceReference +from kubernetes_asyncio.client.models.apiextensions_v1_webhook_client_config import ApiextensionsV1WebhookClientConfig +from kubernetes_asyncio.client.models.apiregistration_v1_service_reference import ApiregistrationV1ServiceReference +from kubernetes_asyncio.client.models.authentication_v1_token_request import AuthenticationV1TokenRequest +from kubernetes_asyncio.client.models.core_v1_endpoint_port import CoreV1EndpointPort +from kubernetes_asyncio.client.models.core_v1_event import CoreV1Event +from kubernetes_asyncio.client.models.core_v1_event_list import CoreV1EventList +from kubernetes_asyncio.client.models.core_v1_event_series import CoreV1EventSeries +from kubernetes_asyncio.client.models.core_v1_resource_claim import CoreV1ResourceClaim +from kubernetes_asyncio.client.models.discovery_v1_endpoint_port import DiscoveryV1EndpointPort +from kubernetes_asyncio.client.models.events_v1_event import EventsV1Event +from kubernetes_asyncio.client.models.events_v1_event_list import EventsV1EventList +from kubernetes_asyncio.client.models.events_v1_event_series import EventsV1EventSeries +from kubernetes_asyncio.client.models.flowcontrol_v1_subject import FlowcontrolV1Subject +from kubernetes_asyncio.client.models.rbac_v1_subject import RbacV1Subject +from kubernetes_asyncio.client.models.resource_v1_resource_claim import ResourceV1ResourceClaim +from kubernetes_asyncio.client.models.storage_v1_token_request import StorageV1TokenRequest +from kubernetes_asyncio.client.models.v1_api_group import V1APIGroup +from kubernetes_asyncio.client.models.v1_api_group_list import V1APIGroupList +from kubernetes_asyncio.client.models.v1_api_resource import V1APIResource +from kubernetes_asyncio.client.models.v1_api_resource_list import V1APIResourceList +from kubernetes_asyncio.client.models.v1_api_service import V1APIService +from kubernetes_asyncio.client.models.v1_api_service_condition import V1APIServiceCondition +from kubernetes_asyncio.client.models.v1_api_service_list import V1APIServiceList +from kubernetes_asyncio.client.models.v1_api_service_spec import V1APIServiceSpec +from kubernetes_asyncio.client.models.v1_api_service_status import V1APIServiceStatus +from kubernetes_asyncio.client.models.v1_api_versions import V1APIVersions +from kubernetes_asyncio.client.models.v1_aws_elastic_block_store_volume_source import V1AWSElasticBlockStoreVolumeSource +from kubernetes_asyncio.client.models.v1_affinity import V1Affinity +from kubernetes_asyncio.client.models.v1_aggregation_rule import V1AggregationRule +from kubernetes_asyncio.client.models.v1_allocated_device_status import V1AllocatedDeviceStatus +from kubernetes_asyncio.client.models.v1_allocation_result import V1AllocationResult +from kubernetes_asyncio.client.models.v1_app_armor_profile import V1AppArmorProfile +from kubernetes_asyncio.client.models.v1_attached_volume import V1AttachedVolume +from kubernetes_asyncio.client.models.v1_audit_annotation import V1AuditAnnotation +from kubernetes_asyncio.client.models.v1_azure_disk_volume_source import V1AzureDiskVolumeSource +from kubernetes_asyncio.client.models.v1_azure_file_persistent_volume_source import V1AzureFilePersistentVolumeSource +from kubernetes_asyncio.client.models.v1_azure_file_volume_source import V1AzureFileVolumeSource +from kubernetes_asyncio.client.models.v1_binding import V1Binding +from kubernetes_asyncio.client.models.v1_bound_object_reference import V1BoundObjectReference +from kubernetes_asyncio.client.models.v1_cel_device_selector import V1CELDeviceSelector +from kubernetes_asyncio.client.models.v1_csi_driver import V1CSIDriver +from kubernetes_asyncio.client.models.v1_csi_driver_list import V1CSIDriverList +from kubernetes_asyncio.client.models.v1_csi_driver_spec import V1CSIDriverSpec +from kubernetes_asyncio.client.models.v1_csi_node import V1CSINode +from kubernetes_asyncio.client.models.v1_csi_node_driver import V1CSINodeDriver +from kubernetes_asyncio.client.models.v1_csi_node_list import V1CSINodeList +from kubernetes_asyncio.client.models.v1_csi_node_spec import V1CSINodeSpec +from kubernetes_asyncio.client.models.v1_csi_persistent_volume_source import V1CSIPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_csi_storage_capacity import V1CSIStorageCapacity +from kubernetes_asyncio.client.models.v1_csi_storage_capacity_list import V1CSIStorageCapacityList +from kubernetes_asyncio.client.models.v1_csi_volume_source import V1CSIVolumeSource +from kubernetes_asyncio.client.models.v1_capabilities import V1Capabilities +from kubernetes_asyncio.client.models.v1_capacity_request_policy import V1CapacityRequestPolicy +from kubernetes_asyncio.client.models.v1_capacity_request_policy_range import V1CapacityRequestPolicyRange +from kubernetes_asyncio.client.models.v1_capacity_requirements import V1CapacityRequirements +from kubernetes_asyncio.client.models.v1_ceph_fs_persistent_volume_source import V1CephFSPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_ceph_fs_volume_source import V1CephFSVolumeSource +from kubernetes_asyncio.client.models.v1_certificate_signing_request import V1CertificateSigningRequest +from kubernetes_asyncio.client.models.v1_certificate_signing_request_condition import V1CertificateSigningRequestCondition +from kubernetes_asyncio.client.models.v1_certificate_signing_request_list import V1CertificateSigningRequestList +from kubernetes_asyncio.client.models.v1_certificate_signing_request_spec import V1CertificateSigningRequestSpec +from kubernetes_asyncio.client.models.v1_certificate_signing_request_status import V1CertificateSigningRequestStatus +from kubernetes_asyncio.client.models.v1_cinder_persistent_volume_source import V1CinderPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_cinder_volume_source import V1CinderVolumeSource +from kubernetes_asyncio.client.models.v1_client_ip_config import V1ClientIPConfig +from kubernetes_asyncio.client.models.v1_cluster_role import V1ClusterRole +from kubernetes_asyncio.client.models.v1_cluster_role_binding import V1ClusterRoleBinding +from kubernetes_asyncio.client.models.v1_cluster_role_binding_list import V1ClusterRoleBindingList +from kubernetes_asyncio.client.models.v1_cluster_role_list import V1ClusterRoleList +from kubernetes_asyncio.client.models.v1_cluster_trust_bundle_projection import V1ClusterTrustBundleProjection +from kubernetes_asyncio.client.models.v1_component_condition import V1ComponentCondition +from kubernetes_asyncio.client.models.v1_component_status import V1ComponentStatus +from kubernetes_asyncio.client.models.v1_component_status_list import V1ComponentStatusList +from kubernetes_asyncio.client.models.v1_condition import V1Condition +from kubernetes_asyncio.client.models.v1_config_map import V1ConfigMap +from kubernetes_asyncio.client.models.v1_config_map_env_source import V1ConfigMapEnvSource +from kubernetes_asyncio.client.models.v1_config_map_key_selector import V1ConfigMapKeySelector +from kubernetes_asyncio.client.models.v1_config_map_list import V1ConfigMapList +from kubernetes_asyncio.client.models.v1_config_map_node_config_source import V1ConfigMapNodeConfigSource +from kubernetes_asyncio.client.models.v1_config_map_projection import V1ConfigMapProjection +from kubernetes_asyncio.client.models.v1_config_map_volume_source import V1ConfigMapVolumeSource +from kubernetes_asyncio.client.models.v1_container import V1Container +from kubernetes_asyncio.client.models.v1_container_extended_resource_request import V1ContainerExtendedResourceRequest +from kubernetes_asyncio.client.models.v1_container_image import V1ContainerImage +from kubernetes_asyncio.client.models.v1_container_port import V1ContainerPort +from kubernetes_asyncio.client.models.v1_container_resize_policy import V1ContainerResizePolicy +from kubernetes_asyncio.client.models.v1_container_restart_rule import V1ContainerRestartRule +from kubernetes_asyncio.client.models.v1_container_restart_rule_on_exit_codes import V1ContainerRestartRuleOnExitCodes +from kubernetes_asyncio.client.models.v1_container_state import V1ContainerState +from kubernetes_asyncio.client.models.v1_container_state_running import V1ContainerStateRunning +from kubernetes_asyncio.client.models.v1_container_state_terminated import V1ContainerStateTerminated +from kubernetes_asyncio.client.models.v1_container_state_waiting import V1ContainerStateWaiting +from kubernetes_asyncio.client.models.v1_container_status import V1ContainerStatus +from kubernetes_asyncio.client.models.v1_container_user import V1ContainerUser +from kubernetes_asyncio.client.models.v1_controller_revision import V1ControllerRevision +from kubernetes_asyncio.client.models.v1_controller_revision_list import V1ControllerRevisionList +from kubernetes_asyncio.client.models.v1_counter import V1Counter +from kubernetes_asyncio.client.models.v1_counter_set import V1CounterSet +from kubernetes_asyncio.client.models.v1_cron_job import V1CronJob +from kubernetes_asyncio.client.models.v1_cron_job_list import V1CronJobList +from kubernetes_asyncio.client.models.v1_cron_job_spec import V1CronJobSpec +from kubernetes_asyncio.client.models.v1_cron_job_status import V1CronJobStatus +from kubernetes_asyncio.client.models.v1_cross_version_object_reference import V1CrossVersionObjectReference +from kubernetes_asyncio.client.models.v1_custom_resource_column_definition import V1CustomResourceColumnDefinition +from kubernetes_asyncio.client.models.v1_custom_resource_conversion import V1CustomResourceConversion +from kubernetes_asyncio.client.models.v1_custom_resource_definition import V1CustomResourceDefinition +from kubernetes_asyncio.client.models.v1_custom_resource_definition_condition import V1CustomResourceDefinitionCondition +from kubernetes_asyncio.client.models.v1_custom_resource_definition_list import V1CustomResourceDefinitionList +from kubernetes_asyncio.client.models.v1_custom_resource_definition_names import V1CustomResourceDefinitionNames +from kubernetes_asyncio.client.models.v1_custom_resource_definition_spec import V1CustomResourceDefinitionSpec +from kubernetes_asyncio.client.models.v1_custom_resource_definition_status import V1CustomResourceDefinitionStatus +from kubernetes_asyncio.client.models.v1_custom_resource_definition_version import V1CustomResourceDefinitionVersion +from kubernetes_asyncio.client.models.v1_custom_resource_subresource_scale import V1CustomResourceSubresourceScale +from kubernetes_asyncio.client.models.v1_custom_resource_subresources import V1CustomResourceSubresources +from kubernetes_asyncio.client.models.v1_custom_resource_validation import V1CustomResourceValidation +from kubernetes_asyncio.client.models.v1_daemon_endpoint import V1DaemonEndpoint +from kubernetes_asyncio.client.models.v1_daemon_set import V1DaemonSet +from kubernetes_asyncio.client.models.v1_daemon_set_condition import V1DaemonSetCondition +from kubernetes_asyncio.client.models.v1_daemon_set_list import V1DaemonSetList +from kubernetes_asyncio.client.models.v1_daemon_set_spec import V1DaemonSetSpec +from kubernetes_asyncio.client.models.v1_daemon_set_status import V1DaemonSetStatus +from kubernetes_asyncio.client.models.v1_daemon_set_update_strategy import V1DaemonSetUpdateStrategy +from kubernetes_asyncio.client.models.v1_delete_options import V1DeleteOptions +from kubernetes_asyncio.client.models.v1_deployment import V1Deployment +from kubernetes_asyncio.client.models.v1_deployment_condition import V1DeploymentCondition +from kubernetes_asyncio.client.models.v1_deployment_list import V1DeploymentList +from kubernetes_asyncio.client.models.v1_deployment_spec import V1DeploymentSpec +from kubernetes_asyncio.client.models.v1_deployment_status import V1DeploymentStatus +from kubernetes_asyncio.client.models.v1_deployment_strategy import V1DeploymentStrategy +from kubernetes_asyncio.client.models.v1_device import V1Device +from kubernetes_asyncio.client.models.v1_device_allocation_configuration import V1DeviceAllocationConfiguration +from kubernetes_asyncio.client.models.v1_device_allocation_result import V1DeviceAllocationResult +from kubernetes_asyncio.client.models.v1_device_attribute import V1DeviceAttribute +from kubernetes_asyncio.client.models.v1_device_capacity import V1DeviceCapacity +from kubernetes_asyncio.client.models.v1_device_claim import V1DeviceClaim +from kubernetes_asyncio.client.models.v1_device_claim_configuration import V1DeviceClaimConfiguration +from kubernetes_asyncio.client.models.v1_device_class import V1DeviceClass +from kubernetes_asyncio.client.models.v1_device_class_configuration import V1DeviceClassConfiguration +from kubernetes_asyncio.client.models.v1_device_class_list import V1DeviceClassList +from kubernetes_asyncio.client.models.v1_device_class_spec import V1DeviceClassSpec +from kubernetes_asyncio.client.models.v1_device_constraint import V1DeviceConstraint +from kubernetes_asyncio.client.models.v1_device_counter_consumption import V1DeviceCounterConsumption +from kubernetes_asyncio.client.models.v1_device_request import V1DeviceRequest +from kubernetes_asyncio.client.models.v1_device_request_allocation_result import V1DeviceRequestAllocationResult +from kubernetes_asyncio.client.models.v1_device_selector import V1DeviceSelector +from kubernetes_asyncio.client.models.v1_device_sub_request import V1DeviceSubRequest +from kubernetes_asyncio.client.models.v1_device_taint import V1DeviceTaint +from kubernetes_asyncio.client.models.v1_device_toleration import V1DeviceToleration +from kubernetes_asyncio.client.models.v1_downward_api_projection import V1DownwardAPIProjection +from kubernetes_asyncio.client.models.v1_downward_api_volume_file import V1DownwardAPIVolumeFile +from kubernetes_asyncio.client.models.v1_downward_api_volume_source import V1DownwardAPIVolumeSource +from kubernetes_asyncio.client.models.v1_empty_dir_volume_source import V1EmptyDirVolumeSource +from kubernetes_asyncio.client.models.v1_endpoint import V1Endpoint +from kubernetes_asyncio.client.models.v1_endpoint_address import V1EndpointAddress +from kubernetes_asyncio.client.models.v1_endpoint_conditions import V1EndpointConditions +from kubernetes_asyncio.client.models.v1_endpoint_hints import V1EndpointHints +from kubernetes_asyncio.client.models.v1_endpoint_slice import V1EndpointSlice +from kubernetes_asyncio.client.models.v1_endpoint_slice_list import V1EndpointSliceList +from kubernetes_asyncio.client.models.v1_endpoint_subset import V1EndpointSubset +from kubernetes_asyncio.client.models.v1_endpoints import V1Endpoints +from kubernetes_asyncio.client.models.v1_endpoints_list import V1EndpointsList +from kubernetes_asyncio.client.models.v1_env_from_source import V1EnvFromSource +from kubernetes_asyncio.client.models.v1_env_var import V1EnvVar +from kubernetes_asyncio.client.models.v1_env_var_source import V1EnvVarSource +from kubernetes_asyncio.client.models.v1_ephemeral_container import V1EphemeralContainer +from kubernetes_asyncio.client.models.v1_ephemeral_volume_source import V1EphemeralVolumeSource +from kubernetes_asyncio.client.models.v1_event_source import V1EventSource +from kubernetes_asyncio.client.models.v1_eviction import V1Eviction +from kubernetes_asyncio.client.models.v1_exact_device_request import V1ExactDeviceRequest +from kubernetes_asyncio.client.models.v1_exec_action import V1ExecAction +from kubernetes_asyncio.client.models.v1_exempt_priority_level_configuration import V1ExemptPriorityLevelConfiguration +from kubernetes_asyncio.client.models.v1_expression_warning import V1ExpressionWarning +from kubernetes_asyncio.client.models.v1_external_documentation import V1ExternalDocumentation +from kubernetes_asyncio.client.models.v1_fc_volume_source import V1FCVolumeSource +from kubernetes_asyncio.client.models.v1_field_selector_attributes import V1FieldSelectorAttributes +from kubernetes_asyncio.client.models.v1_field_selector_requirement import V1FieldSelectorRequirement +from kubernetes_asyncio.client.models.v1_file_key_selector import V1FileKeySelector +from kubernetes_asyncio.client.models.v1_flex_persistent_volume_source import V1FlexPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_flex_volume_source import V1FlexVolumeSource +from kubernetes_asyncio.client.models.v1_flocker_volume_source import V1FlockerVolumeSource +from kubernetes_asyncio.client.models.v1_flow_distinguisher_method import V1FlowDistinguisherMethod +from kubernetes_asyncio.client.models.v1_flow_schema import V1FlowSchema +from kubernetes_asyncio.client.models.v1_flow_schema_condition import V1FlowSchemaCondition +from kubernetes_asyncio.client.models.v1_flow_schema_list import V1FlowSchemaList +from kubernetes_asyncio.client.models.v1_flow_schema_spec import V1FlowSchemaSpec +from kubernetes_asyncio.client.models.v1_flow_schema_status import V1FlowSchemaStatus +from kubernetes_asyncio.client.models.v1_for_node import V1ForNode +from kubernetes_asyncio.client.models.v1_for_zone import V1ForZone +from kubernetes_asyncio.client.models.v1_gce_persistent_disk_volume_source import V1GCEPersistentDiskVolumeSource +from kubernetes_asyncio.client.models.v1_grpc_action import V1GRPCAction +from kubernetes_asyncio.client.models.v1_git_repo_volume_source import V1GitRepoVolumeSource +from kubernetes_asyncio.client.models.v1_glusterfs_persistent_volume_source import V1GlusterfsPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_glusterfs_volume_source import V1GlusterfsVolumeSource +from kubernetes_asyncio.client.models.v1_group_resource import V1GroupResource +from kubernetes_asyncio.client.models.v1_group_subject import V1GroupSubject +from kubernetes_asyncio.client.models.v1_group_version_for_discovery import V1GroupVersionForDiscovery +from kubernetes_asyncio.client.models.v1_http_get_action import V1HTTPGetAction +from kubernetes_asyncio.client.models.v1_http_header import V1HTTPHeader +from kubernetes_asyncio.client.models.v1_http_ingress_path import V1HTTPIngressPath +from kubernetes_asyncio.client.models.v1_http_ingress_rule_value import V1HTTPIngressRuleValue +from kubernetes_asyncio.client.models.v1_horizontal_pod_autoscaler import V1HorizontalPodAutoscaler +from kubernetes_asyncio.client.models.v1_horizontal_pod_autoscaler_list import V1HorizontalPodAutoscalerList +from kubernetes_asyncio.client.models.v1_horizontal_pod_autoscaler_spec import V1HorizontalPodAutoscalerSpec +from kubernetes_asyncio.client.models.v1_horizontal_pod_autoscaler_status import V1HorizontalPodAutoscalerStatus +from kubernetes_asyncio.client.models.v1_host_alias import V1HostAlias +from kubernetes_asyncio.client.models.v1_host_ip import V1HostIP +from kubernetes_asyncio.client.models.v1_host_path_volume_source import V1HostPathVolumeSource +from kubernetes_asyncio.client.models.v1_ip_address import V1IPAddress +from kubernetes_asyncio.client.models.v1_ip_address_list import V1IPAddressList +from kubernetes_asyncio.client.models.v1_ip_address_spec import V1IPAddressSpec +from kubernetes_asyncio.client.models.v1_ip_block import V1IPBlock +from kubernetes_asyncio.client.models.v1_iscsi_persistent_volume_source import V1ISCSIPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_iscsi_volume_source import V1ISCSIVolumeSource +from kubernetes_asyncio.client.models.v1_image_volume_source import V1ImageVolumeSource +from kubernetes_asyncio.client.models.v1_ingress import V1Ingress +from kubernetes_asyncio.client.models.v1_ingress_backend import V1IngressBackend +from kubernetes_asyncio.client.models.v1_ingress_class import V1IngressClass +from kubernetes_asyncio.client.models.v1_ingress_class_list import V1IngressClassList +from kubernetes_asyncio.client.models.v1_ingress_class_parameters_reference import V1IngressClassParametersReference +from kubernetes_asyncio.client.models.v1_ingress_class_spec import V1IngressClassSpec +from kubernetes_asyncio.client.models.v1_ingress_list import V1IngressList +from kubernetes_asyncio.client.models.v1_ingress_load_balancer_ingress import V1IngressLoadBalancerIngress +from kubernetes_asyncio.client.models.v1_ingress_load_balancer_status import V1IngressLoadBalancerStatus +from kubernetes_asyncio.client.models.v1_ingress_port_status import V1IngressPortStatus +from kubernetes_asyncio.client.models.v1_ingress_rule import V1IngressRule +from kubernetes_asyncio.client.models.v1_ingress_service_backend import V1IngressServiceBackend +from kubernetes_asyncio.client.models.v1_ingress_spec import V1IngressSpec +from kubernetes_asyncio.client.models.v1_ingress_status import V1IngressStatus +from kubernetes_asyncio.client.models.v1_ingress_tls import V1IngressTLS +from kubernetes_asyncio.client.models.v1_json_schema_props import V1JSONSchemaProps +from kubernetes_asyncio.client.models.v1_job import V1Job +from kubernetes_asyncio.client.models.v1_job_condition import V1JobCondition +from kubernetes_asyncio.client.models.v1_job_list import V1JobList +from kubernetes_asyncio.client.models.v1_job_spec import V1JobSpec +from kubernetes_asyncio.client.models.v1_job_status import V1JobStatus +from kubernetes_asyncio.client.models.v1_job_template_spec import V1JobTemplateSpec +from kubernetes_asyncio.client.models.v1_key_to_path import V1KeyToPath +from kubernetes_asyncio.client.models.v1_label_selector import V1LabelSelector +from kubernetes_asyncio.client.models.v1_label_selector_attributes import V1LabelSelectorAttributes +from kubernetes_asyncio.client.models.v1_label_selector_requirement import V1LabelSelectorRequirement +from kubernetes_asyncio.client.models.v1_lease import V1Lease +from kubernetes_asyncio.client.models.v1_lease_list import V1LeaseList +from kubernetes_asyncio.client.models.v1_lease_spec import V1LeaseSpec +from kubernetes_asyncio.client.models.v1_lifecycle import V1Lifecycle +from kubernetes_asyncio.client.models.v1_lifecycle_handler import V1LifecycleHandler +from kubernetes_asyncio.client.models.v1_limit_range import V1LimitRange +from kubernetes_asyncio.client.models.v1_limit_range_item import V1LimitRangeItem +from kubernetes_asyncio.client.models.v1_limit_range_list import V1LimitRangeList +from kubernetes_asyncio.client.models.v1_limit_range_spec import V1LimitRangeSpec +from kubernetes_asyncio.client.models.v1_limit_response import V1LimitResponse +from kubernetes_asyncio.client.models.v1_limited_priority_level_configuration import V1LimitedPriorityLevelConfiguration +from kubernetes_asyncio.client.models.v1_linux_container_user import V1LinuxContainerUser +from kubernetes_asyncio.client.models.v1_list_meta import V1ListMeta +from kubernetes_asyncio.client.models.v1_load_balancer_ingress import V1LoadBalancerIngress +from kubernetes_asyncio.client.models.v1_load_balancer_status import V1LoadBalancerStatus +from kubernetes_asyncio.client.models.v1_local_object_reference import V1LocalObjectReference +from kubernetes_asyncio.client.models.v1_local_subject_access_review import V1LocalSubjectAccessReview +from kubernetes_asyncio.client.models.v1_local_volume_source import V1LocalVolumeSource +from kubernetes_asyncio.client.models.v1_managed_fields_entry import V1ManagedFieldsEntry +from kubernetes_asyncio.client.models.v1_match_condition import V1MatchCondition +from kubernetes_asyncio.client.models.v1_match_resources import V1MatchResources +from kubernetes_asyncio.client.models.v1_modify_volume_status import V1ModifyVolumeStatus +from kubernetes_asyncio.client.models.v1_mutating_webhook import V1MutatingWebhook +from kubernetes_asyncio.client.models.v1_mutating_webhook_configuration import V1MutatingWebhookConfiguration +from kubernetes_asyncio.client.models.v1_mutating_webhook_configuration_list import V1MutatingWebhookConfigurationList +from kubernetes_asyncio.client.models.v1_nfs_volume_source import V1NFSVolumeSource +from kubernetes_asyncio.client.models.v1_named_rule_with_operations import V1NamedRuleWithOperations +from kubernetes_asyncio.client.models.v1_namespace import V1Namespace +from kubernetes_asyncio.client.models.v1_namespace_condition import V1NamespaceCondition +from kubernetes_asyncio.client.models.v1_namespace_list import V1NamespaceList +from kubernetes_asyncio.client.models.v1_namespace_spec import V1NamespaceSpec +from kubernetes_asyncio.client.models.v1_namespace_status import V1NamespaceStatus +from kubernetes_asyncio.client.models.v1_network_device_data import V1NetworkDeviceData +from kubernetes_asyncio.client.models.v1_network_policy import V1NetworkPolicy +from kubernetes_asyncio.client.models.v1_network_policy_egress_rule import V1NetworkPolicyEgressRule +from kubernetes_asyncio.client.models.v1_network_policy_ingress_rule import V1NetworkPolicyIngressRule +from kubernetes_asyncio.client.models.v1_network_policy_list import V1NetworkPolicyList +from kubernetes_asyncio.client.models.v1_network_policy_peer import V1NetworkPolicyPeer +from kubernetes_asyncio.client.models.v1_network_policy_port import V1NetworkPolicyPort +from kubernetes_asyncio.client.models.v1_network_policy_spec import V1NetworkPolicySpec +from kubernetes_asyncio.client.models.v1_node import V1Node +from kubernetes_asyncio.client.models.v1_node_address import V1NodeAddress +from kubernetes_asyncio.client.models.v1_node_affinity import V1NodeAffinity +from kubernetes_asyncio.client.models.v1_node_condition import V1NodeCondition +from kubernetes_asyncio.client.models.v1_node_config_source import V1NodeConfigSource +from kubernetes_asyncio.client.models.v1_node_config_status import V1NodeConfigStatus +from kubernetes_asyncio.client.models.v1_node_daemon_endpoints import V1NodeDaemonEndpoints +from kubernetes_asyncio.client.models.v1_node_features import V1NodeFeatures +from kubernetes_asyncio.client.models.v1_node_list import V1NodeList +from kubernetes_asyncio.client.models.v1_node_runtime_handler import V1NodeRuntimeHandler +from kubernetes_asyncio.client.models.v1_node_runtime_handler_features import V1NodeRuntimeHandlerFeatures +from kubernetes_asyncio.client.models.v1_node_selector import V1NodeSelector +from kubernetes_asyncio.client.models.v1_node_selector_requirement import V1NodeSelectorRequirement +from kubernetes_asyncio.client.models.v1_node_selector_term import V1NodeSelectorTerm +from kubernetes_asyncio.client.models.v1_node_spec import V1NodeSpec +from kubernetes_asyncio.client.models.v1_node_status import V1NodeStatus +from kubernetes_asyncio.client.models.v1_node_swap_status import V1NodeSwapStatus +from kubernetes_asyncio.client.models.v1_node_system_info import V1NodeSystemInfo +from kubernetes_asyncio.client.models.v1_non_resource_attributes import V1NonResourceAttributes +from kubernetes_asyncio.client.models.v1_non_resource_policy_rule import V1NonResourcePolicyRule +from kubernetes_asyncio.client.models.v1_non_resource_rule import V1NonResourceRule +from kubernetes_asyncio.client.models.v1_object_field_selector import V1ObjectFieldSelector +from kubernetes_asyncio.client.models.v1_object_meta import V1ObjectMeta +from kubernetes_asyncio.client.models.v1_object_reference import V1ObjectReference +from kubernetes_asyncio.client.models.v1_opaque_device_configuration import V1OpaqueDeviceConfiguration +from kubernetes_asyncio.client.models.v1_overhead import V1Overhead +from kubernetes_asyncio.client.models.v1_owner_reference import V1OwnerReference +from kubernetes_asyncio.client.models.v1_param_kind import V1ParamKind +from kubernetes_asyncio.client.models.v1_param_ref import V1ParamRef +from kubernetes_asyncio.client.models.v1_parent_reference import V1ParentReference +from kubernetes_asyncio.client.models.v1_persistent_volume import V1PersistentVolume +from kubernetes_asyncio.client.models.v1_persistent_volume_claim import V1PersistentVolumeClaim +from kubernetes_asyncio.client.models.v1_persistent_volume_claim_condition import V1PersistentVolumeClaimCondition +from kubernetes_asyncio.client.models.v1_persistent_volume_claim_list import V1PersistentVolumeClaimList +from kubernetes_asyncio.client.models.v1_persistent_volume_claim_spec import V1PersistentVolumeClaimSpec +from kubernetes_asyncio.client.models.v1_persistent_volume_claim_status import V1PersistentVolumeClaimStatus +from kubernetes_asyncio.client.models.v1_persistent_volume_claim_template import V1PersistentVolumeClaimTemplate +from kubernetes_asyncio.client.models.v1_persistent_volume_claim_volume_source import V1PersistentVolumeClaimVolumeSource +from kubernetes_asyncio.client.models.v1_persistent_volume_list import V1PersistentVolumeList +from kubernetes_asyncio.client.models.v1_persistent_volume_spec import V1PersistentVolumeSpec +from kubernetes_asyncio.client.models.v1_persistent_volume_status import V1PersistentVolumeStatus +from kubernetes_asyncio.client.models.v1_photon_persistent_disk_volume_source import V1PhotonPersistentDiskVolumeSource +from kubernetes_asyncio.client.models.v1_pod import V1Pod +from kubernetes_asyncio.client.models.v1_pod_affinity import V1PodAffinity +from kubernetes_asyncio.client.models.v1_pod_affinity_term import V1PodAffinityTerm +from kubernetes_asyncio.client.models.v1_pod_anti_affinity import V1PodAntiAffinity +from kubernetes_asyncio.client.models.v1_pod_certificate_projection import V1PodCertificateProjection +from kubernetes_asyncio.client.models.v1_pod_condition import V1PodCondition +from kubernetes_asyncio.client.models.v1_pod_dns_config import V1PodDNSConfig +from kubernetes_asyncio.client.models.v1_pod_dns_config_option import V1PodDNSConfigOption +from kubernetes_asyncio.client.models.v1_pod_disruption_budget import V1PodDisruptionBudget +from kubernetes_asyncio.client.models.v1_pod_disruption_budget_list import V1PodDisruptionBudgetList +from kubernetes_asyncio.client.models.v1_pod_disruption_budget_spec import V1PodDisruptionBudgetSpec +from kubernetes_asyncio.client.models.v1_pod_disruption_budget_status import V1PodDisruptionBudgetStatus +from kubernetes_asyncio.client.models.v1_pod_extended_resource_claim_status import V1PodExtendedResourceClaimStatus +from kubernetes_asyncio.client.models.v1_pod_failure_policy import V1PodFailurePolicy +from kubernetes_asyncio.client.models.v1_pod_failure_policy_on_exit_codes_requirement import V1PodFailurePolicyOnExitCodesRequirement +from kubernetes_asyncio.client.models.v1_pod_failure_policy_on_pod_conditions_pattern import V1PodFailurePolicyOnPodConditionsPattern +from kubernetes_asyncio.client.models.v1_pod_failure_policy_rule import V1PodFailurePolicyRule +from kubernetes_asyncio.client.models.v1_pod_ip import V1PodIP +from kubernetes_asyncio.client.models.v1_pod_list import V1PodList +from kubernetes_asyncio.client.models.v1_pod_os import V1PodOS +from kubernetes_asyncio.client.models.v1_pod_readiness_gate import V1PodReadinessGate +from kubernetes_asyncio.client.models.v1_pod_resource_claim import V1PodResourceClaim +from kubernetes_asyncio.client.models.v1_pod_resource_claim_status import V1PodResourceClaimStatus +from kubernetes_asyncio.client.models.v1_pod_scheduling_gate import V1PodSchedulingGate +from kubernetes_asyncio.client.models.v1_pod_security_context import V1PodSecurityContext +from kubernetes_asyncio.client.models.v1_pod_spec import V1PodSpec +from kubernetes_asyncio.client.models.v1_pod_status import V1PodStatus +from kubernetes_asyncio.client.models.v1_pod_template import V1PodTemplate +from kubernetes_asyncio.client.models.v1_pod_template_list import V1PodTemplateList +from kubernetes_asyncio.client.models.v1_pod_template_spec import V1PodTemplateSpec +from kubernetes_asyncio.client.models.v1_policy_rule import V1PolicyRule +from kubernetes_asyncio.client.models.v1_policy_rules_with_subjects import V1PolicyRulesWithSubjects +from kubernetes_asyncio.client.models.v1_port_status import V1PortStatus +from kubernetes_asyncio.client.models.v1_portworx_volume_source import V1PortworxVolumeSource +from kubernetes_asyncio.client.models.v1_preconditions import V1Preconditions +from kubernetes_asyncio.client.models.v1_preferred_scheduling_term import V1PreferredSchedulingTerm +from kubernetes_asyncio.client.models.v1_priority_class import V1PriorityClass +from kubernetes_asyncio.client.models.v1_priority_class_list import V1PriorityClassList +from kubernetes_asyncio.client.models.v1_priority_level_configuration import V1PriorityLevelConfiguration +from kubernetes_asyncio.client.models.v1_priority_level_configuration_condition import V1PriorityLevelConfigurationCondition +from kubernetes_asyncio.client.models.v1_priority_level_configuration_list import V1PriorityLevelConfigurationList +from kubernetes_asyncio.client.models.v1_priority_level_configuration_reference import V1PriorityLevelConfigurationReference +from kubernetes_asyncio.client.models.v1_priority_level_configuration_spec import V1PriorityLevelConfigurationSpec +from kubernetes_asyncio.client.models.v1_priority_level_configuration_status import V1PriorityLevelConfigurationStatus +from kubernetes_asyncio.client.models.v1_probe import V1Probe +from kubernetes_asyncio.client.models.v1_projected_volume_source import V1ProjectedVolumeSource +from kubernetes_asyncio.client.models.v1_queuing_configuration import V1QueuingConfiguration +from kubernetes_asyncio.client.models.v1_quobyte_volume_source import V1QuobyteVolumeSource +from kubernetes_asyncio.client.models.v1_rbd_persistent_volume_source import V1RBDPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_rbd_volume_source import V1RBDVolumeSource +from kubernetes_asyncio.client.models.v1_replica_set import V1ReplicaSet +from kubernetes_asyncio.client.models.v1_replica_set_condition import V1ReplicaSetCondition +from kubernetes_asyncio.client.models.v1_replica_set_list import V1ReplicaSetList +from kubernetes_asyncio.client.models.v1_replica_set_spec import V1ReplicaSetSpec +from kubernetes_asyncio.client.models.v1_replica_set_status import V1ReplicaSetStatus +from kubernetes_asyncio.client.models.v1_replication_controller import V1ReplicationController +from kubernetes_asyncio.client.models.v1_replication_controller_condition import V1ReplicationControllerCondition +from kubernetes_asyncio.client.models.v1_replication_controller_list import V1ReplicationControllerList +from kubernetes_asyncio.client.models.v1_replication_controller_spec import V1ReplicationControllerSpec +from kubernetes_asyncio.client.models.v1_replication_controller_status import V1ReplicationControllerStatus +from kubernetes_asyncio.client.models.v1_resource_attributes import V1ResourceAttributes +from kubernetes_asyncio.client.models.v1_resource_claim_consumer_reference import V1ResourceClaimConsumerReference +from kubernetes_asyncio.client.models.v1_resource_claim_list import V1ResourceClaimList +from kubernetes_asyncio.client.models.v1_resource_claim_spec import V1ResourceClaimSpec +from kubernetes_asyncio.client.models.v1_resource_claim_status import V1ResourceClaimStatus +from kubernetes_asyncio.client.models.v1_resource_claim_template import V1ResourceClaimTemplate +from kubernetes_asyncio.client.models.v1_resource_claim_template_list import V1ResourceClaimTemplateList +from kubernetes_asyncio.client.models.v1_resource_claim_template_spec import V1ResourceClaimTemplateSpec +from kubernetes_asyncio.client.models.v1_resource_field_selector import V1ResourceFieldSelector +from kubernetes_asyncio.client.models.v1_resource_health import V1ResourceHealth +from kubernetes_asyncio.client.models.v1_resource_policy_rule import V1ResourcePolicyRule +from kubernetes_asyncio.client.models.v1_resource_pool import V1ResourcePool +from kubernetes_asyncio.client.models.v1_resource_quota import V1ResourceQuota +from kubernetes_asyncio.client.models.v1_resource_quota_list import V1ResourceQuotaList +from kubernetes_asyncio.client.models.v1_resource_quota_spec import V1ResourceQuotaSpec +from kubernetes_asyncio.client.models.v1_resource_quota_status import V1ResourceQuotaStatus +from kubernetes_asyncio.client.models.v1_resource_requirements import V1ResourceRequirements +from kubernetes_asyncio.client.models.v1_resource_rule import V1ResourceRule +from kubernetes_asyncio.client.models.v1_resource_slice import V1ResourceSlice +from kubernetes_asyncio.client.models.v1_resource_slice_list import V1ResourceSliceList +from kubernetes_asyncio.client.models.v1_resource_slice_spec import V1ResourceSliceSpec +from kubernetes_asyncio.client.models.v1_resource_status import V1ResourceStatus +from kubernetes_asyncio.client.models.v1_role import V1Role +from kubernetes_asyncio.client.models.v1_role_binding import V1RoleBinding +from kubernetes_asyncio.client.models.v1_role_binding_list import V1RoleBindingList +from kubernetes_asyncio.client.models.v1_role_list import V1RoleList +from kubernetes_asyncio.client.models.v1_role_ref import V1RoleRef +from kubernetes_asyncio.client.models.v1_rolling_update_daemon_set import V1RollingUpdateDaemonSet +from kubernetes_asyncio.client.models.v1_rolling_update_deployment import V1RollingUpdateDeployment +from kubernetes_asyncio.client.models.v1_rolling_update_stateful_set_strategy import V1RollingUpdateStatefulSetStrategy +from kubernetes_asyncio.client.models.v1_rule_with_operations import V1RuleWithOperations +from kubernetes_asyncio.client.models.v1_runtime_class import V1RuntimeClass +from kubernetes_asyncio.client.models.v1_runtime_class_list import V1RuntimeClassList +from kubernetes_asyncio.client.models.v1_se_linux_options import V1SELinuxOptions +from kubernetes_asyncio.client.models.v1_scale import V1Scale +from kubernetes_asyncio.client.models.v1_scale_io_persistent_volume_source import V1ScaleIOPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_scale_io_volume_source import V1ScaleIOVolumeSource +from kubernetes_asyncio.client.models.v1_scale_spec import V1ScaleSpec +from kubernetes_asyncio.client.models.v1_scale_status import V1ScaleStatus +from kubernetes_asyncio.client.models.v1_scheduling import V1Scheduling +from kubernetes_asyncio.client.models.v1_scope_selector import V1ScopeSelector +from kubernetes_asyncio.client.models.v1_scoped_resource_selector_requirement import V1ScopedResourceSelectorRequirement +from kubernetes_asyncio.client.models.v1_seccomp_profile import V1SeccompProfile +from kubernetes_asyncio.client.models.v1_secret import V1Secret +from kubernetes_asyncio.client.models.v1_secret_env_source import V1SecretEnvSource +from kubernetes_asyncio.client.models.v1_secret_key_selector import V1SecretKeySelector +from kubernetes_asyncio.client.models.v1_secret_list import V1SecretList +from kubernetes_asyncio.client.models.v1_secret_projection import V1SecretProjection +from kubernetes_asyncio.client.models.v1_secret_reference import V1SecretReference +from kubernetes_asyncio.client.models.v1_secret_volume_source import V1SecretVolumeSource +from kubernetes_asyncio.client.models.v1_security_context import V1SecurityContext +from kubernetes_asyncio.client.models.v1_selectable_field import V1SelectableField +from kubernetes_asyncio.client.models.v1_self_subject_access_review import V1SelfSubjectAccessReview +from kubernetes_asyncio.client.models.v1_self_subject_access_review_spec import V1SelfSubjectAccessReviewSpec +from kubernetes_asyncio.client.models.v1_self_subject_review import V1SelfSubjectReview +from kubernetes_asyncio.client.models.v1_self_subject_review_status import V1SelfSubjectReviewStatus +from kubernetes_asyncio.client.models.v1_self_subject_rules_review import V1SelfSubjectRulesReview +from kubernetes_asyncio.client.models.v1_self_subject_rules_review_spec import V1SelfSubjectRulesReviewSpec +from kubernetes_asyncio.client.models.v1_server_address_by_client_cidr import V1ServerAddressByClientCIDR +from kubernetes_asyncio.client.models.v1_service import V1Service +from kubernetes_asyncio.client.models.v1_service_account import V1ServiceAccount +from kubernetes_asyncio.client.models.v1_service_account_list import V1ServiceAccountList +from kubernetes_asyncio.client.models.v1_service_account_subject import V1ServiceAccountSubject +from kubernetes_asyncio.client.models.v1_service_account_token_projection import V1ServiceAccountTokenProjection +from kubernetes_asyncio.client.models.v1_service_backend_port import V1ServiceBackendPort +from kubernetes_asyncio.client.models.v1_service_cidr import V1ServiceCIDR +from kubernetes_asyncio.client.models.v1_service_cidr_list import V1ServiceCIDRList +from kubernetes_asyncio.client.models.v1_service_cidr_spec import V1ServiceCIDRSpec +from kubernetes_asyncio.client.models.v1_service_cidr_status import V1ServiceCIDRStatus +from kubernetes_asyncio.client.models.v1_service_list import V1ServiceList +from kubernetes_asyncio.client.models.v1_service_port import V1ServicePort +from kubernetes_asyncio.client.models.v1_service_spec import V1ServiceSpec +from kubernetes_asyncio.client.models.v1_service_status import V1ServiceStatus +from kubernetes_asyncio.client.models.v1_session_affinity_config import V1SessionAffinityConfig +from kubernetes_asyncio.client.models.v1_sleep_action import V1SleepAction +from kubernetes_asyncio.client.models.v1_stateful_set import V1StatefulSet +from kubernetes_asyncio.client.models.v1_stateful_set_condition import V1StatefulSetCondition +from kubernetes_asyncio.client.models.v1_stateful_set_list import V1StatefulSetList +from kubernetes_asyncio.client.models.v1_stateful_set_ordinals import V1StatefulSetOrdinals +from kubernetes_asyncio.client.models.v1_stateful_set_persistent_volume_claim_retention_policy import V1StatefulSetPersistentVolumeClaimRetentionPolicy +from kubernetes_asyncio.client.models.v1_stateful_set_spec import V1StatefulSetSpec +from kubernetes_asyncio.client.models.v1_stateful_set_status import V1StatefulSetStatus +from kubernetes_asyncio.client.models.v1_stateful_set_update_strategy import V1StatefulSetUpdateStrategy +from kubernetes_asyncio.client.models.v1_status import V1Status +from kubernetes_asyncio.client.models.v1_status_cause import V1StatusCause +from kubernetes_asyncio.client.models.v1_status_details import V1StatusDetails +from kubernetes_asyncio.client.models.v1_storage_class import V1StorageClass +from kubernetes_asyncio.client.models.v1_storage_class_list import V1StorageClassList +from kubernetes_asyncio.client.models.v1_storage_os_persistent_volume_source import V1StorageOSPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_storage_os_volume_source import V1StorageOSVolumeSource +from kubernetes_asyncio.client.models.v1_subject_access_review import V1SubjectAccessReview +from kubernetes_asyncio.client.models.v1_subject_access_review_spec import V1SubjectAccessReviewSpec +from kubernetes_asyncio.client.models.v1_subject_access_review_status import V1SubjectAccessReviewStatus +from kubernetes_asyncio.client.models.v1_subject_rules_review_status import V1SubjectRulesReviewStatus +from kubernetes_asyncio.client.models.v1_success_policy import V1SuccessPolicy +from kubernetes_asyncio.client.models.v1_success_policy_rule import V1SuccessPolicyRule +from kubernetes_asyncio.client.models.v1_sysctl import V1Sysctl +from kubernetes_asyncio.client.models.v1_tcp_socket_action import V1TCPSocketAction +from kubernetes_asyncio.client.models.v1_taint import V1Taint +from kubernetes_asyncio.client.models.v1_token_request_spec import V1TokenRequestSpec +from kubernetes_asyncio.client.models.v1_token_request_status import V1TokenRequestStatus +from kubernetes_asyncio.client.models.v1_token_review import V1TokenReview +from kubernetes_asyncio.client.models.v1_token_review_spec import V1TokenReviewSpec +from kubernetes_asyncio.client.models.v1_token_review_status import V1TokenReviewStatus +from kubernetes_asyncio.client.models.v1_toleration import V1Toleration +from kubernetes_asyncio.client.models.v1_topology_selector_label_requirement import V1TopologySelectorLabelRequirement +from kubernetes_asyncio.client.models.v1_topology_selector_term import V1TopologySelectorTerm +from kubernetes_asyncio.client.models.v1_topology_spread_constraint import V1TopologySpreadConstraint +from kubernetes_asyncio.client.models.v1_type_checking import V1TypeChecking +from kubernetes_asyncio.client.models.v1_typed_local_object_reference import V1TypedLocalObjectReference +from kubernetes_asyncio.client.models.v1_typed_object_reference import V1TypedObjectReference +from kubernetes_asyncio.client.models.v1_uncounted_terminated_pods import V1UncountedTerminatedPods +from kubernetes_asyncio.client.models.v1_user_info import V1UserInfo +from kubernetes_asyncio.client.models.v1_user_subject import V1UserSubject +from kubernetes_asyncio.client.models.v1_validating_admission_policy import V1ValidatingAdmissionPolicy +from kubernetes_asyncio.client.models.v1_validating_admission_policy_binding import V1ValidatingAdmissionPolicyBinding +from kubernetes_asyncio.client.models.v1_validating_admission_policy_binding_list import V1ValidatingAdmissionPolicyBindingList +from kubernetes_asyncio.client.models.v1_validating_admission_policy_binding_spec import V1ValidatingAdmissionPolicyBindingSpec +from kubernetes_asyncio.client.models.v1_validating_admission_policy_list import V1ValidatingAdmissionPolicyList +from kubernetes_asyncio.client.models.v1_validating_admission_policy_spec import V1ValidatingAdmissionPolicySpec +from kubernetes_asyncio.client.models.v1_validating_admission_policy_status import V1ValidatingAdmissionPolicyStatus +from kubernetes_asyncio.client.models.v1_validating_webhook import V1ValidatingWebhook +from kubernetes_asyncio.client.models.v1_validating_webhook_configuration import V1ValidatingWebhookConfiguration +from kubernetes_asyncio.client.models.v1_validating_webhook_configuration_list import V1ValidatingWebhookConfigurationList +from kubernetes_asyncio.client.models.v1_validation import V1Validation +from kubernetes_asyncio.client.models.v1_validation_rule import V1ValidationRule +from kubernetes_asyncio.client.models.v1_variable import V1Variable +from kubernetes_asyncio.client.models.v1_volume import V1Volume +from kubernetes_asyncio.client.models.v1_volume_attachment import V1VolumeAttachment +from kubernetes_asyncio.client.models.v1_volume_attachment_list import V1VolumeAttachmentList +from kubernetes_asyncio.client.models.v1_volume_attachment_source import V1VolumeAttachmentSource +from kubernetes_asyncio.client.models.v1_volume_attachment_spec import V1VolumeAttachmentSpec +from kubernetes_asyncio.client.models.v1_volume_attachment_status import V1VolumeAttachmentStatus +from kubernetes_asyncio.client.models.v1_volume_attributes_class import V1VolumeAttributesClass +from kubernetes_asyncio.client.models.v1_volume_attributes_class_list import V1VolumeAttributesClassList +from kubernetes_asyncio.client.models.v1_volume_device import V1VolumeDevice +from kubernetes_asyncio.client.models.v1_volume_error import V1VolumeError +from kubernetes_asyncio.client.models.v1_volume_mount import V1VolumeMount +from kubernetes_asyncio.client.models.v1_volume_mount_status import V1VolumeMountStatus +from kubernetes_asyncio.client.models.v1_volume_node_affinity import V1VolumeNodeAffinity +from kubernetes_asyncio.client.models.v1_volume_node_resources import V1VolumeNodeResources +from kubernetes_asyncio.client.models.v1_volume_projection import V1VolumeProjection +from kubernetes_asyncio.client.models.v1_volume_resource_requirements import V1VolumeResourceRequirements +from kubernetes_asyncio.client.models.v1_vsphere_virtual_disk_volume_source import V1VsphereVirtualDiskVolumeSource +from kubernetes_asyncio.client.models.v1_watch_event import V1WatchEvent +from kubernetes_asyncio.client.models.v1_webhook_conversion import V1WebhookConversion +from kubernetes_asyncio.client.models.v1_weighted_pod_affinity_term import V1WeightedPodAffinityTerm +from kubernetes_asyncio.client.models.v1_windows_security_context_options import V1WindowsSecurityContextOptions +from kubernetes_asyncio.client.models.v1_workload_reference import V1WorkloadReference +from kubernetes_asyncio.client.models.v1alpha1_apply_configuration import V1alpha1ApplyConfiguration +from kubernetes_asyncio.client.models.v1alpha1_cluster_trust_bundle import V1alpha1ClusterTrustBundle +from kubernetes_asyncio.client.models.v1alpha1_cluster_trust_bundle_list import V1alpha1ClusterTrustBundleList +from kubernetes_asyncio.client.models.v1alpha1_cluster_trust_bundle_spec import V1alpha1ClusterTrustBundleSpec +from kubernetes_asyncio.client.models.v1alpha1_gang_scheduling_policy import V1alpha1GangSchedulingPolicy +from kubernetes_asyncio.client.models.v1alpha1_json_patch import V1alpha1JSONPatch +from kubernetes_asyncio.client.models.v1alpha1_match_condition import V1alpha1MatchCondition +from kubernetes_asyncio.client.models.v1alpha1_match_resources import V1alpha1MatchResources +from kubernetes_asyncio.client.models.v1alpha1_mutating_admission_policy import V1alpha1MutatingAdmissionPolicy +from kubernetes_asyncio.client.models.v1alpha1_mutating_admission_policy_binding import V1alpha1MutatingAdmissionPolicyBinding +from kubernetes_asyncio.client.models.v1alpha1_mutating_admission_policy_binding_list import V1alpha1MutatingAdmissionPolicyBindingList +from kubernetes_asyncio.client.models.v1alpha1_mutating_admission_policy_binding_spec import V1alpha1MutatingAdmissionPolicyBindingSpec +from kubernetes_asyncio.client.models.v1alpha1_mutating_admission_policy_list import V1alpha1MutatingAdmissionPolicyList +from kubernetes_asyncio.client.models.v1alpha1_mutating_admission_policy_spec import V1alpha1MutatingAdmissionPolicySpec +from kubernetes_asyncio.client.models.v1alpha1_mutation import V1alpha1Mutation +from kubernetes_asyncio.client.models.v1alpha1_named_rule_with_operations import V1alpha1NamedRuleWithOperations +from kubernetes_asyncio.client.models.v1alpha1_param_kind import V1alpha1ParamKind +from kubernetes_asyncio.client.models.v1alpha1_param_ref import V1alpha1ParamRef +from kubernetes_asyncio.client.models.v1alpha1_pod_group import V1alpha1PodGroup +from kubernetes_asyncio.client.models.v1alpha1_pod_group_policy import V1alpha1PodGroupPolicy +from kubernetes_asyncio.client.models.v1alpha1_server_storage_version import V1alpha1ServerStorageVersion +from kubernetes_asyncio.client.models.v1alpha1_storage_version import V1alpha1StorageVersion +from kubernetes_asyncio.client.models.v1alpha1_storage_version_condition import V1alpha1StorageVersionCondition +from kubernetes_asyncio.client.models.v1alpha1_storage_version_list import V1alpha1StorageVersionList +from kubernetes_asyncio.client.models.v1alpha1_storage_version_status import V1alpha1StorageVersionStatus +from kubernetes_asyncio.client.models.v1alpha1_typed_local_object_reference import V1alpha1TypedLocalObjectReference +from kubernetes_asyncio.client.models.v1alpha1_variable import V1alpha1Variable +from kubernetes_asyncio.client.models.v1alpha1_workload import V1alpha1Workload +from kubernetes_asyncio.client.models.v1alpha1_workload_list import V1alpha1WorkloadList +from kubernetes_asyncio.client.models.v1alpha1_workload_spec import V1alpha1WorkloadSpec +from kubernetes_asyncio.client.models.v1alpha2_lease_candidate import V1alpha2LeaseCandidate +from kubernetes_asyncio.client.models.v1alpha2_lease_candidate_list import V1alpha2LeaseCandidateList +from kubernetes_asyncio.client.models.v1alpha2_lease_candidate_spec import V1alpha2LeaseCandidateSpec +from kubernetes_asyncio.client.models.v1alpha3_device_taint import V1alpha3DeviceTaint +from kubernetes_asyncio.client.models.v1alpha3_device_taint_rule import V1alpha3DeviceTaintRule +from kubernetes_asyncio.client.models.v1alpha3_device_taint_rule_list import V1alpha3DeviceTaintRuleList +from kubernetes_asyncio.client.models.v1alpha3_device_taint_rule_spec import V1alpha3DeviceTaintRuleSpec +from kubernetes_asyncio.client.models.v1alpha3_device_taint_rule_status import V1alpha3DeviceTaintRuleStatus +from kubernetes_asyncio.client.models.v1alpha3_device_taint_selector import V1alpha3DeviceTaintSelector +from kubernetes_asyncio.client.models.v1beta1_allocated_device_status import V1beta1AllocatedDeviceStatus +from kubernetes_asyncio.client.models.v1beta1_allocation_result import V1beta1AllocationResult +from kubernetes_asyncio.client.models.v1beta1_apply_configuration import V1beta1ApplyConfiguration +from kubernetes_asyncio.client.models.v1beta1_basic_device import V1beta1BasicDevice +from kubernetes_asyncio.client.models.v1beta1_cel_device_selector import V1beta1CELDeviceSelector +from kubernetes_asyncio.client.models.v1beta1_capacity_request_policy import V1beta1CapacityRequestPolicy +from kubernetes_asyncio.client.models.v1beta1_capacity_request_policy_range import V1beta1CapacityRequestPolicyRange +from kubernetes_asyncio.client.models.v1beta1_capacity_requirements import V1beta1CapacityRequirements +from kubernetes_asyncio.client.models.v1beta1_cluster_trust_bundle import V1beta1ClusterTrustBundle +from kubernetes_asyncio.client.models.v1beta1_cluster_trust_bundle_list import V1beta1ClusterTrustBundleList +from kubernetes_asyncio.client.models.v1beta1_cluster_trust_bundle_spec import V1beta1ClusterTrustBundleSpec +from kubernetes_asyncio.client.models.v1beta1_counter import V1beta1Counter +from kubernetes_asyncio.client.models.v1beta1_counter_set import V1beta1CounterSet +from kubernetes_asyncio.client.models.v1beta1_device import V1beta1Device +from kubernetes_asyncio.client.models.v1beta1_device_allocation_configuration import V1beta1DeviceAllocationConfiguration +from kubernetes_asyncio.client.models.v1beta1_device_allocation_result import V1beta1DeviceAllocationResult +from kubernetes_asyncio.client.models.v1beta1_device_attribute import V1beta1DeviceAttribute +from kubernetes_asyncio.client.models.v1beta1_device_capacity import V1beta1DeviceCapacity +from kubernetes_asyncio.client.models.v1beta1_device_claim import V1beta1DeviceClaim +from kubernetes_asyncio.client.models.v1beta1_device_claim_configuration import V1beta1DeviceClaimConfiguration +from kubernetes_asyncio.client.models.v1beta1_device_class import V1beta1DeviceClass +from kubernetes_asyncio.client.models.v1beta1_device_class_configuration import V1beta1DeviceClassConfiguration +from kubernetes_asyncio.client.models.v1beta1_device_class_list import V1beta1DeviceClassList +from kubernetes_asyncio.client.models.v1beta1_device_class_spec import V1beta1DeviceClassSpec +from kubernetes_asyncio.client.models.v1beta1_device_constraint import V1beta1DeviceConstraint +from kubernetes_asyncio.client.models.v1beta1_device_counter_consumption import V1beta1DeviceCounterConsumption +from kubernetes_asyncio.client.models.v1beta1_device_request import V1beta1DeviceRequest +from kubernetes_asyncio.client.models.v1beta1_device_request_allocation_result import V1beta1DeviceRequestAllocationResult +from kubernetes_asyncio.client.models.v1beta1_device_selector import V1beta1DeviceSelector +from kubernetes_asyncio.client.models.v1beta1_device_sub_request import V1beta1DeviceSubRequest +from kubernetes_asyncio.client.models.v1beta1_device_taint import V1beta1DeviceTaint +from kubernetes_asyncio.client.models.v1beta1_device_toleration import V1beta1DeviceToleration +from kubernetes_asyncio.client.models.v1beta1_ip_address import V1beta1IPAddress +from kubernetes_asyncio.client.models.v1beta1_ip_address_list import V1beta1IPAddressList +from kubernetes_asyncio.client.models.v1beta1_ip_address_spec import V1beta1IPAddressSpec +from kubernetes_asyncio.client.models.v1beta1_json_patch import V1beta1JSONPatch +from kubernetes_asyncio.client.models.v1beta1_lease_candidate import V1beta1LeaseCandidate +from kubernetes_asyncio.client.models.v1beta1_lease_candidate_list import V1beta1LeaseCandidateList +from kubernetes_asyncio.client.models.v1beta1_lease_candidate_spec import V1beta1LeaseCandidateSpec +from kubernetes_asyncio.client.models.v1beta1_match_condition import V1beta1MatchCondition +from kubernetes_asyncio.client.models.v1beta1_match_resources import V1beta1MatchResources +from kubernetes_asyncio.client.models.v1beta1_mutating_admission_policy import V1beta1MutatingAdmissionPolicy +from kubernetes_asyncio.client.models.v1beta1_mutating_admission_policy_binding import V1beta1MutatingAdmissionPolicyBinding +from kubernetes_asyncio.client.models.v1beta1_mutating_admission_policy_binding_list import V1beta1MutatingAdmissionPolicyBindingList +from kubernetes_asyncio.client.models.v1beta1_mutating_admission_policy_binding_spec import V1beta1MutatingAdmissionPolicyBindingSpec +from kubernetes_asyncio.client.models.v1beta1_mutating_admission_policy_list import V1beta1MutatingAdmissionPolicyList +from kubernetes_asyncio.client.models.v1beta1_mutating_admission_policy_spec import V1beta1MutatingAdmissionPolicySpec +from kubernetes_asyncio.client.models.v1beta1_mutation import V1beta1Mutation +from kubernetes_asyncio.client.models.v1beta1_named_rule_with_operations import V1beta1NamedRuleWithOperations +from kubernetes_asyncio.client.models.v1beta1_network_device_data import V1beta1NetworkDeviceData +from kubernetes_asyncio.client.models.v1beta1_opaque_device_configuration import V1beta1OpaqueDeviceConfiguration +from kubernetes_asyncio.client.models.v1beta1_param_kind import V1beta1ParamKind +from kubernetes_asyncio.client.models.v1beta1_param_ref import V1beta1ParamRef +from kubernetes_asyncio.client.models.v1beta1_parent_reference import V1beta1ParentReference +from kubernetes_asyncio.client.models.v1beta1_pod_certificate_request import V1beta1PodCertificateRequest +from kubernetes_asyncio.client.models.v1beta1_pod_certificate_request_list import V1beta1PodCertificateRequestList +from kubernetes_asyncio.client.models.v1beta1_pod_certificate_request_spec import V1beta1PodCertificateRequestSpec +from kubernetes_asyncio.client.models.v1beta1_pod_certificate_request_status import V1beta1PodCertificateRequestStatus +from kubernetes_asyncio.client.models.v1beta1_resource_claim import V1beta1ResourceClaim +from kubernetes_asyncio.client.models.v1beta1_resource_claim_consumer_reference import V1beta1ResourceClaimConsumerReference +from kubernetes_asyncio.client.models.v1beta1_resource_claim_list import V1beta1ResourceClaimList +from kubernetes_asyncio.client.models.v1beta1_resource_claim_spec import V1beta1ResourceClaimSpec +from kubernetes_asyncio.client.models.v1beta1_resource_claim_status import V1beta1ResourceClaimStatus +from kubernetes_asyncio.client.models.v1beta1_resource_claim_template import V1beta1ResourceClaimTemplate +from kubernetes_asyncio.client.models.v1beta1_resource_claim_template_list import V1beta1ResourceClaimTemplateList +from kubernetes_asyncio.client.models.v1beta1_resource_claim_template_spec import V1beta1ResourceClaimTemplateSpec +from kubernetes_asyncio.client.models.v1beta1_resource_pool import V1beta1ResourcePool +from kubernetes_asyncio.client.models.v1beta1_resource_slice import V1beta1ResourceSlice +from kubernetes_asyncio.client.models.v1beta1_resource_slice_list import V1beta1ResourceSliceList +from kubernetes_asyncio.client.models.v1beta1_resource_slice_spec import V1beta1ResourceSliceSpec +from kubernetes_asyncio.client.models.v1beta1_service_cidr import V1beta1ServiceCIDR +from kubernetes_asyncio.client.models.v1beta1_service_cidr_list import V1beta1ServiceCIDRList +from kubernetes_asyncio.client.models.v1beta1_service_cidr_spec import V1beta1ServiceCIDRSpec +from kubernetes_asyncio.client.models.v1beta1_service_cidr_status import V1beta1ServiceCIDRStatus +from kubernetes_asyncio.client.models.v1beta1_storage_version_migration import V1beta1StorageVersionMigration +from kubernetes_asyncio.client.models.v1beta1_storage_version_migration_list import V1beta1StorageVersionMigrationList +from kubernetes_asyncio.client.models.v1beta1_storage_version_migration_spec import V1beta1StorageVersionMigrationSpec +from kubernetes_asyncio.client.models.v1beta1_storage_version_migration_status import V1beta1StorageVersionMigrationStatus +from kubernetes_asyncio.client.models.v1beta1_variable import V1beta1Variable +from kubernetes_asyncio.client.models.v1beta1_volume_attributes_class import V1beta1VolumeAttributesClass +from kubernetes_asyncio.client.models.v1beta1_volume_attributes_class_list import V1beta1VolumeAttributesClassList +from kubernetes_asyncio.client.models.v1beta2_allocated_device_status import V1beta2AllocatedDeviceStatus +from kubernetes_asyncio.client.models.v1beta2_allocation_result import V1beta2AllocationResult +from kubernetes_asyncio.client.models.v1beta2_cel_device_selector import V1beta2CELDeviceSelector +from kubernetes_asyncio.client.models.v1beta2_capacity_request_policy import V1beta2CapacityRequestPolicy +from kubernetes_asyncio.client.models.v1beta2_capacity_request_policy_range import V1beta2CapacityRequestPolicyRange +from kubernetes_asyncio.client.models.v1beta2_capacity_requirements import V1beta2CapacityRequirements +from kubernetes_asyncio.client.models.v1beta2_counter import V1beta2Counter +from kubernetes_asyncio.client.models.v1beta2_counter_set import V1beta2CounterSet +from kubernetes_asyncio.client.models.v1beta2_device import V1beta2Device +from kubernetes_asyncio.client.models.v1beta2_device_allocation_configuration import V1beta2DeviceAllocationConfiguration +from kubernetes_asyncio.client.models.v1beta2_device_allocation_result import V1beta2DeviceAllocationResult +from kubernetes_asyncio.client.models.v1beta2_device_attribute import V1beta2DeviceAttribute +from kubernetes_asyncio.client.models.v1beta2_device_capacity import V1beta2DeviceCapacity +from kubernetes_asyncio.client.models.v1beta2_device_claim import V1beta2DeviceClaim +from kubernetes_asyncio.client.models.v1beta2_device_claim_configuration import V1beta2DeviceClaimConfiguration +from kubernetes_asyncio.client.models.v1beta2_device_class import V1beta2DeviceClass +from kubernetes_asyncio.client.models.v1beta2_device_class_configuration import V1beta2DeviceClassConfiguration +from kubernetes_asyncio.client.models.v1beta2_device_class_list import V1beta2DeviceClassList +from kubernetes_asyncio.client.models.v1beta2_device_class_spec import V1beta2DeviceClassSpec +from kubernetes_asyncio.client.models.v1beta2_device_constraint import V1beta2DeviceConstraint +from kubernetes_asyncio.client.models.v1beta2_device_counter_consumption import V1beta2DeviceCounterConsumption +from kubernetes_asyncio.client.models.v1beta2_device_request import V1beta2DeviceRequest +from kubernetes_asyncio.client.models.v1beta2_device_request_allocation_result import V1beta2DeviceRequestAllocationResult +from kubernetes_asyncio.client.models.v1beta2_device_selector import V1beta2DeviceSelector +from kubernetes_asyncio.client.models.v1beta2_device_sub_request import V1beta2DeviceSubRequest +from kubernetes_asyncio.client.models.v1beta2_device_taint import V1beta2DeviceTaint +from kubernetes_asyncio.client.models.v1beta2_device_toleration import V1beta2DeviceToleration +from kubernetes_asyncio.client.models.v1beta2_exact_device_request import V1beta2ExactDeviceRequest +from kubernetes_asyncio.client.models.v1beta2_network_device_data import V1beta2NetworkDeviceData +from kubernetes_asyncio.client.models.v1beta2_opaque_device_configuration import V1beta2OpaqueDeviceConfiguration +from kubernetes_asyncio.client.models.v1beta2_resource_claim import V1beta2ResourceClaim +from kubernetes_asyncio.client.models.v1beta2_resource_claim_consumer_reference import V1beta2ResourceClaimConsumerReference +from kubernetes_asyncio.client.models.v1beta2_resource_claim_list import V1beta2ResourceClaimList +from kubernetes_asyncio.client.models.v1beta2_resource_claim_spec import V1beta2ResourceClaimSpec +from kubernetes_asyncio.client.models.v1beta2_resource_claim_status import V1beta2ResourceClaimStatus +from kubernetes_asyncio.client.models.v1beta2_resource_claim_template import V1beta2ResourceClaimTemplate +from kubernetes_asyncio.client.models.v1beta2_resource_claim_template_list import V1beta2ResourceClaimTemplateList +from kubernetes_asyncio.client.models.v1beta2_resource_claim_template_spec import V1beta2ResourceClaimTemplateSpec +from kubernetes_asyncio.client.models.v1beta2_resource_pool import V1beta2ResourcePool +from kubernetes_asyncio.client.models.v1beta2_resource_slice import V1beta2ResourceSlice +from kubernetes_asyncio.client.models.v1beta2_resource_slice_list import V1beta2ResourceSliceList +from kubernetes_asyncio.client.models.v1beta2_resource_slice_spec import V1beta2ResourceSliceSpec +from kubernetes_asyncio.client.models.v2_api_group_discovery import V2APIGroupDiscovery +from kubernetes_asyncio.client.models.v2_api_group_discovery_list import V2APIGroupDiscoveryList +from kubernetes_asyncio.client.models.v2_api_resource_discovery import V2APIResourceDiscovery +from kubernetes_asyncio.client.models.v2_api_subresource_discovery import V2APISubresourceDiscovery +from kubernetes_asyncio.client.models.v2_api_version_discovery import V2APIVersionDiscovery +from kubernetes_asyncio.client.models.v2_container_resource_metric_source import V2ContainerResourceMetricSource +from kubernetes_asyncio.client.models.v2_container_resource_metric_status import V2ContainerResourceMetricStatus +from kubernetes_asyncio.client.models.v2_cross_version_object_reference import V2CrossVersionObjectReference +from kubernetes_asyncio.client.models.v2_external_metric_source import V2ExternalMetricSource +from kubernetes_asyncio.client.models.v2_external_metric_status import V2ExternalMetricStatus +from kubernetes_asyncio.client.models.v2_hpa_scaling_policy import V2HPAScalingPolicy +from kubernetes_asyncio.client.models.v2_hpa_scaling_rules import V2HPAScalingRules +from kubernetes_asyncio.client.models.v2_horizontal_pod_autoscaler import V2HorizontalPodAutoscaler +from kubernetes_asyncio.client.models.v2_horizontal_pod_autoscaler_behavior import V2HorizontalPodAutoscalerBehavior +from kubernetes_asyncio.client.models.v2_horizontal_pod_autoscaler_condition import V2HorizontalPodAutoscalerCondition +from kubernetes_asyncio.client.models.v2_horizontal_pod_autoscaler_list import V2HorizontalPodAutoscalerList +from kubernetes_asyncio.client.models.v2_horizontal_pod_autoscaler_spec import V2HorizontalPodAutoscalerSpec +from kubernetes_asyncio.client.models.v2_horizontal_pod_autoscaler_status import V2HorizontalPodAutoscalerStatus +from kubernetes_asyncio.client.models.v2_metric_identifier import V2MetricIdentifier +from kubernetes_asyncio.client.models.v2_metric_spec import V2MetricSpec +from kubernetes_asyncio.client.models.v2_metric_status import V2MetricStatus +from kubernetes_asyncio.client.models.v2_metric_target import V2MetricTarget +from kubernetes_asyncio.client.models.v2_metric_value_status import V2MetricValueStatus +from kubernetes_asyncio.client.models.v2_object_metric_source import V2ObjectMetricSource +from kubernetes_asyncio.client.models.v2_object_metric_status import V2ObjectMetricStatus +from kubernetes_asyncio.client.models.v2_pods_metric_source import V2PodsMetricSource +from kubernetes_asyncio.client.models.v2_pods_metric_status import V2PodsMetricStatus +from kubernetes_asyncio.client.models.v2_resource_metric_source import V2ResourceMetricSource +from kubernetes_asyncio.client.models.v2_resource_metric_status import V2ResourceMetricStatus +from kubernetes_asyncio.client.models.v2beta1_api_group_discovery import V2beta1APIGroupDiscovery +from kubernetes_asyncio.client.models.v2beta1_api_group_discovery_list import V2beta1APIGroupDiscoveryList +from kubernetes_asyncio.client.models.v2beta1_api_resource_discovery import V2beta1APIResourceDiscovery +from kubernetes_asyncio.client.models.v2beta1_api_subresource_discovery import V2beta1APISubresourceDiscovery +from kubernetes_asyncio.client.models.v2beta1_api_version_discovery import V2beta1APIVersionDiscovery +from kubernetes_asyncio.client.models.version_info import VersionInfo + diff --git a/kubernetes_asyncio/client/api/__init__.py b/kubernetes_asyncio/client/api/__init__.py new file mode 100644 index 0000000000..5206978d3c --- /dev/null +++ b/kubernetes_asyncio/client/api/__init__.py @@ -0,0 +1,70 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from kubernetes_asyncio.client.api.well_known_api import WellKnownApi +from kubernetes_asyncio.client.api.admissionregistration_api import AdmissionregistrationApi +from kubernetes_asyncio.client.api.admissionregistration_v1_api import AdmissionregistrationV1Api +from kubernetes_asyncio.client.api.admissionregistration_v1alpha1_api import AdmissionregistrationV1alpha1Api +from kubernetes_asyncio.client.api.admissionregistration_v1beta1_api import AdmissionregistrationV1beta1Api +from kubernetes_asyncio.client.api.apiextensions_api import ApiextensionsApi +from kubernetes_asyncio.client.api.apiextensions_v1_api import ApiextensionsV1Api +from kubernetes_asyncio.client.api.apiregistration_api import ApiregistrationApi +from kubernetes_asyncio.client.api.apiregistration_v1_api import ApiregistrationV1Api +from kubernetes_asyncio.client.api.apis_api import ApisApi +from kubernetes_asyncio.client.api.apps_api import AppsApi +from kubernetes_asyncio.client.api.apps_v1_api import AppsV1Api +from kubernetes_asyncio.client.api.authentication_api import AuthenticationApi +from kubernetes_asyncio.client.api.authentication_v1_api import AuthenticationV1Api +from kubernetes_asyncio.client.api.authorization_api import AuthorizationApi +from kubernetes_asyncio.client.api.authorization_v1_api import AuthorizationV1Api +from kubernetes_asyncio.client.api.autoscaling_api import AutoscalingApi +from kubernetes_asyncio.client.api.autoscaling_v1_api import AutoscalingV1Api +from kubernetes_asyncio.client.api.autoscaling_v2_api import AutoscalingV2Api +from kubernetes_asyncio.client.api.batch_api import BatchApi +from kubernetes_asyncio.client.api.batch_v1_api import BatchV1Api +from kubernetes_asyncio.client.api.certificates_api import CertificatesApi +from kubernetes_asyncio.client.api.certificates_v1_api import CertificatesV1Api +from kubernetes_asyncio.client.api.certificates_v1alpha1_api import CertificatesV1alpha1Api +from kubernetes_asyncio.client.api.certificates_v1beta1_api import CertificatesV1beta1Api +from kubernetes_asyncio.client.api.coordination_api import CoordinationApi +from kubernetes_asyncio.client.api.coordination_v1_api import CoordinationV1Api +from kubernetes_asyncio.client.api.coordination_v1alpha2_api import CoordinationV1alpha2Api +from kubernetes_asyncio.client.api.coordination_v1beta1_api import CoordinationV1beta1Api +from kubernetes_asyncio.client.api.core_api import CoreApi +from kubernetes_asyncio.client.api.core_v1_api import CoreV1Api +from kubernetes_asyncio.client.api.custom_objects_api import CustomObjectsApi +from kubernetes_asyncio.client.api.discovery_api import DiscoveryApi +from kubernetes_asyncio.client.api.discovery_v1_api import DiscoveryV1Api +from kubernetes_asyncio.client.api.events_api import EventsApi +from kubernetes_asyncio.client.api.events_v1_api import EventsV1Api +from kubernetes_asyncio.client.api.flowcontrol_apiserver_api import FlowcontrolApiserverApi +from kubernetes_asyncio.client.api.flowcontrol_apiserver_v1_api import FlowcontrolApiserverV1Api +from kubernetes_asyncio.client.api.internal_apiserver_api import InternalApiserverApi +from kubernetes_asyncio.client.api.internal_apiserver_v1alpha1_api import InternalApiserverV1alpha1Api +from kubernetes_asyncio.client.api.logs_api import LogsApi +from kubernetes_asyncio.client.api.networking_api import NetworkingApi +from kubernetes_asyncio.client.api.networking_v1_api import NetworkingV1Api +from kubernetes_asyncio.client.api.networking_v1beta1_api import NetworkingV1beta1Api +from kubernetes_asyncio.client.api.node_api import NodeApi +from kubernetes_asyncio.client.api.node_v1_api import NodeV1Api +from kubernetes_asyncio.client.api.openid_api import OpenidApi +from kubernetes_asyncio.client.api.policy_api import PolicyApi +from kubernetes_asyncio.client.api.policy_v1_api import PolicyV1Api +from kubernetes_asyncio.client.api.rbac_authorization_api import RbacAuthorizationApi +from kubernetes_asyncio.client.api.rbac_authorization_v1_api import RbacAuthorizationV1Api +from kubernetes_asyncio.client.api.resource_api import ResourceApi +from kubernetes_asyncio.client.api.resource_v1_api import ResourceV1Api +from kubernetes_asyncio.client.api.resource_v1alpha3_api import ResourceV1alpha3Api +from kubernetes_asyncio.client.api.resource_v1beta1_api import ResourceV1beta1Api +from kubernetes_asyncio.client.api.resource_v1beta2_api import ResourceV1beta2Api +from kubernetes_asyncio.client.api.scheduling_api import SchedulingApi +from kubernetes_asyncio.client.api.scheduling_v1_api import SchedulingV1Api +from kubernetes_asyncio.client.api.scheduling_v1alpha1_api import SchedulingV1alpha1Api +from kubernetes_asyncio.client.api.storage_api import StorageApi +from kubernetes_asyncio.client.api.storage_v1_api import StorageV1Api +from kubernetes_asyncio.client.api.storage_v1beta1_api import StorageV1beta1Api +from kubernetes_asyncio.client.api.storagemigration_api import StoragemigrationApi +from kubernetes_asyncio.client.api.storagemigration_v1beta1_api import StoragemigrationV1beta1Api +from kubernetes_asyncio.client.api.version_api import VersionApi diff --git a/kubernetes_asyncio/client/api/admissionregistration_api.py b/kubernetes_asyncio/client/api/admissionregistration_api.py new file mode 100644 index 0000000000..094070ff88 --- /dev/null +++ b/kubernetes_asyncio/client/api/admissionregistration_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AdmissionregistrationApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/admissionregistration_v1_api.py b/kubernetes_asyncio/client/api/admissionregistration_v1_api.py new file mode 100644 index 0000000000..dc51c94911 --- /dev/null +++ b/kubernetes_asyncio/client/api/admissionregistration_v1_api.py @@ -0,0 +1,5911 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AdmissionregistrationV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_mutating_webhook_configuration(self, body, **kwargs): # noqa: E501 + """create_mutating_webhook_configuration # noqa: E501 + + create a MutatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_mutating_webhook_configuration(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1MutatingWebhookConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1MutatingWebhookConfiguration + """ + kwargs['_return_http_data_only'] = True + 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 + """create_mutating_webhook_configuration # noqa: E501 + + create a MutatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_mutating_webhook_configuration_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1MutatingWebhookConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1MutatingWebhookConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_mutating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_mutating_webhook_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1MutatingWebhookConfiguration", + 201: "V1MutatingWebhookConfiguration", + 202: "V1MutatingWebhookConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_validating_admission_policy(self, body, **kwargs): # noqa: E501 + """create_validating_admission_policy # noqa: E501 + + create a ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_validating_admission_policy(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ValidatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.create_validating_admission_policy_with_http_info(body, **kwargs) # noqa: E501 + + def create_validating_admission_policy_with_http_info(self, body, **kwargs): # noqa: E501 + """create_validating_admission_policy # noqa: E501 + + create a ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_validating_admission_policy_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ValidatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_validating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_validating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingAdmissionPolicy", + 201: "V1ValidatingAdmissionPolicy", + 202: "V1ValidatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_validating_admission_policy_binding(self, body, **kwargs): # noqa: E501 + """create_validating_admission_policy_binding # noqa: E501 + + create a ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_validating_admission_policy_binding(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ValidatingAdmissionPolicyBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingAdmissionPolicyBinding + """ + kwargs['_return_http_data_only'] = True + return self.create_validating_admission_policy_binding_with_http_info(body, **kwargs) # noqa: E501 + + def create_validating_admission_policy_binding_with_http_info(self, body, **kwargs): # noqa: E501 + """create_validating_admission_policy_binding # noqa: E501 + + create a ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_validating_admission_policy_binding_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ValidatingAdmissionPolicyBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingAdmissionPolicyBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_validating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_validating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingAdmissionPolicyBinding", + 201: "V1ValidatingAdmissionPolicyBinding", + 202: "V1ValidatingAdmissionPolicyBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_validating_webhook_configuration(self, body, **kwargs): # noqa: E501 + """create_validating_webhook_configuration # noqa: E501 + + create a ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_validating_webhook_configuration(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ValidatingWebhookConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingWebhookConfiguration + """ + kwargs['_return_http_data_only'] = True + 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 + """create_validating_webhook_configuration # noqa: E501 + + create a ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_validating_webhook_configuration_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ValidatingWebhookConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingWebhookConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_validating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_validating_webhook_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingWebhookConfiguration", + 201: "V1ValidatingWebhookConfiguration", + 202: "V1ValidatingWebhookConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_mutating_webhook_configuration(self, **kwargs): # noqa: E501 + """delete_collection_mutating_webhook_configuration # noqa: E501 + + delete collection of MutatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_mutating_webhook_configuration(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + """delete_collection_mutating_webhook_configuration # noqa: E501 + + delete collection of MutatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_mutating_webhook_configuration_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_mutating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_validating_admission_policy(self, **kwargs): # noqa: E501 + """delete_collection_validating_admission_policy # noqa: E501 + + delete collection of ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_validating_admission_policy(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_validating_admission_policy_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_validating_admission_policy_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_validating_admission_policy # noqa: E501 + + delete collection of ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_validating_admission_policy_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_validating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_validating_admission_policy_binding(self, **kwargs): # noqa: E501 + """delete_collection_validating_admission_policy_binding # noqa: E501 + + delete collection of ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_validating_admission_policy_binding(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_validating_admission_policy_binding_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_validating_admission_policy_binding_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_validating_admission_policy_binding # noqa: E501 + + delete collection of ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_validating_admission_policy_binding_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_validating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_validating_webhook_configuration(self, **kwargs): # noqa: E501 + """delete_collection_validating_webhook_configuration # noqa: E501 + + delete collection of ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_validating_webhook_configuration(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + """delete_collection_validating_webhook_configuration # noqa: E501 + + delete collection of ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_validating_webhook_configuration_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_validating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_mutating_webhook_configuration(self, name, **kwargs): # noqa: E501 + """delete_mutating_webhook_configuration # noqa: E501 + + delete a MutatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_mutating_webhook_configuration(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingWebhookConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + """delete_mutating_webhook_configuration # noqa: E501 + + delete a MutatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_mutating_webhook_configuration_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingWebhookConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_mutating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_mutating_webhook_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_validating_admission_policy(self, name, **kwargs): # noqa: E501 + """delete_validating_admission_policy # noqa: E501 + + delete a ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_validating_admission_policy(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_validating_admission_policy_with_http_info(name, **kwargs) # noqa: E501 + + def delete_validating_admission_policy_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_validating_admission_policy # noqa: E501 + + delete a ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_validating_admission_policy_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_validating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_validating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_validating_admission_policy_binding(self, name, **kwargs): # noqa: E501 + """delete_validating_admission_policy_binding # noqa: E501 + + delete a ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_validating_admission_policy_binding(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicyBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_validating_admission_policy_binding_with_http_info(name, **kwargs) # noqa: E501 + + def delete_validating_admission_policy_binding_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_validating_admission_policy_binding # noqa: E501 + + delete a ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_validating_admission_policy_binding_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicyBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_validating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_validating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_validating_webhook_configuration(self, name, **kwargs): # noqa: E501 + """delete_validating_webhook_configuration # noqa: E501 + + delete a ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_validating_webhook_configuration(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingWebhookConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + """delete_validating_webhook_configuration # noqa: E501 + + delete a ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_validating_webhook_configuration_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingWebhookConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_validating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_validating_webhook_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_mutating_webhook_configuration(self, **kwargs): # noqa: E501 + """list_mutating_webhook_configuration # noqa: E501 + + list or watch objects of kind MutatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_mutating_webhook_configuration(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1MutatingWebhookConfigurationList + """ + kwargs['_return_http_data_only'] = True + return self.list_mutating_webhook_configuration_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_mutating_webhook_configuration_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1MutatingWebhookConfigurationList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_mutating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1MutatingWebhookConfigurationList", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_validating_admission_policy(self, **kwargs): # noqa: E501 + """list_validating_admission_policy # noqa: E501 + + list or watch objects of kind ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_validating_admission_policy(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingAdmissionPolicyList + """ + kwargs['_return_http_data_only'] = True + return self.list_validating_admission_policy_with_http_info(**kwargs) # noqa: E501 + + def list_validating_admission_policy_with_http_info(self, **kwargs): # noqa: E501 + """list_validating_admission_policy # noqa: E501 + + list or watch objects of kind ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_validating_admission_policy_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingAdmissionPolicyList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_validating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingAdmissionPolicyList", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_validating_admission_policy_binding(self, **kwargs): # noqa: E501 + """list_validating_admission_policy_binding # noqa: E501 + + list or watch objects of kind ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_validating_admission_policy_binding(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingAdmissionPolicyBindingList + """ + kwargs['_return_http_data_only'] = True + return self.list_validating_admission_policy_binding_with_http_info(**kwargs) # noqa: E501 + + def list_validating_admission_policy_binding_with_http_info(self, **kwargs): # noqa: E501 + """list_validating_admission_policy_binding # noqa: E501 + + list or watch objects of kind ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_validating_admission_policy_binding_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingAdmissionPolicyBindingList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_validating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingAdmissionPolicyBindingList", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_validating_webhook_configuration(self, **kwargs): # noqa: E501 + """list_validating_webhook_configuration # noqa: E501 + + list or watch objects of kind ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_validating_webhook_configuration(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingWebhookConfigurationList + """ + kwargs['_return_http_data_only'] = True + 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 + + list or watch objects of kind ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_validating_webhook_configuration_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingWebhookConfigurationList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_validating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingWebhookConfigurationList", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_mutating_webhook_configuration(self, name, body, **kwargs): # noqa: E501 + """patch_mutating_webhook_configuration # noqa: E501 + + partially update the specified MutatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_mutating_webhook_configuration(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingWebhookConfiguration (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1MutatingWebhookConfiguration + """ + kwargs['_return_http_data_only'] = True + return self.patch_mutating_webhook_configuration_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_mutating_webhook_configuration_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_mutating_webhook_configuration # noqa: E501 + + partially update the specified MutatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_mutating_webhook_configuration_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingWebhookConfiguration (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1MutatingWebhookConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_mutating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_mutating_webhook_configuration`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_mutating_webhook_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1MutatingWebhookConfiguration", + 201: "V1MutatingWebhookConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_validating_admission_policy(self, name, body, **kwargs): # noqa: E501 + """patch_validating_admission_policy # noqa: E501 + + partially update the specified ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_validating_admission_policy(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.patch_validating_admission_policy_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_validating_admission_policy_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_validating_admission_policy # noqa: E501 + + partially update the specified ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_validating_admission_policy_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_validating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_validating_admission_policy`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_validating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingAdmissionPolicy", + 201: "V1ValidatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_validating_admission_policy_binding(self, name, body, **kwargs): # noqa: E501 + """patch_validating_admission_policy_binding # noqa: E501 + + partially update the specified ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_validating_admission_policy_binding(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicyBinding (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingAdmissionPolicyBinding + """ + kwargs['_return_http_data_only'] = True + return self.patch_validating_admission_policy_binding_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_validating_admission_policy_binding_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_validating_admission_policy_binding # noqa: E501 + + partially update the specified ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_validating_admission_policy_binding_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicyBinding (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingAdmissionPolicyBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_validating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_validating_admission_policy_binding`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_validating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingAdmissionPolicyBinding", + 201: "V1ValidatingAdmissionPolicyBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_validating_admission_policy_status(self, name, body, **kwargs): # noqa: E501 + """patch_validating_admission_policy_status # noqa: E501 + + partially update status of the specified ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_validating_admission_policy_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.patch_validating_admission_policy_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_validating_admission_policy_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_validating_admission_policy_status # noqa: E501 + + partially update status of the specified ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_validating_admission_policy_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_validating_admission_policy_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_validating_admission_policy_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_validating_admission_policy_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingAdmissionPolicy", + 201: "V1ValidatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_validating_webhook_configuration(self, name, body, **kwargs): # noqa: E501 + """patch_validating_webhook_configuration # noqa: E501 + + partially update the specified ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_validating_webhook_configuration(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingWebhookConfiguration (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingWebhookConfiguration + """ + kwargs['_return_http_data_only'] = True + return self.patch_validating_webhook_configuration_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_validating_webhook_configuration_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_validating_webhook_configuration # noqa: E501 + + partially update the specified ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_validating_webhook_configuration_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingWebhookConfiguration (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingWebhookConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_validating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_validating_webhook_configuration`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_validating_webhook_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingWebhookConfiguration", + 201: "V1ValidatingWebhookConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_mutating_webhook_configuration(self, name, **kwargs): # noqa: E501 + """read_mutating_webhook_configuration # noqa: E501 + + read the specified MutatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_mutating_webhook_configuration(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingWebhookConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1MutatingWebhookConfiguration + """ + kwargs['_return_http_data_only'] = True + return self.read_mutating_webhook_configuration_with_http_info(name, **kwargs) # noqa: E501 + + def read_mutating_webhook_configuration_with_http_info(self, name, **kwargs): # noqa: E501 + """read_mutating_webhook_configuration # noqa: E501 + + read the specified MutatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_mutating_webhook_configuration_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingWebhookConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1MutatingWebhookConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_mutating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_mutating_webhook_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1MutatingWebhookConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_validating_admission_policy(self, name, **kwargs): # noqa: E501 + """read_validating_admission_policy # noqa: E501 + + read the specified ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_validating_admission_policy(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.read_validating_admission_policy_with_http_info(name, **kwargs) # noqa: E501 + + def read_validating_admission_policy_with_http_info(self, name, **kwargs): # noqa: E501 + """read_validating_admission_policy # noqa: E501 + + read the specified ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_validating_admission_policy_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_validating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_validating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_validating_admission_policy_binding(self, name, **kwargs): # noqa: E501 + """read_validating_admission_policy_binding # noqa: E501 + + read the specified ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_validating_admission_policy_binding(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicyBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingAdmissionPolicyBinding + """ + kwargs['_return_http_data_only'] = True + return self.read_validating_admission_policy_binding_with_http_info(name, **kwargs) # noqa: E501 + + def read_validating_admission_policy_binding_with_http_info(self, name, **kwargs): # noqa: E501 + """read_validating_admission_policy_binding # noqa: E501 + + read the specified ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_validating_admission_policy_binding_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicyBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingAdmissionPolicyBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_validating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_validating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingAdmissionPolicyBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_validating_admission_policy_status(self, name, **kwargs): # noqa: E501 + """read_validating_admission_policy_status # noqa: E501 + + read status of the specified ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_validating_admission_policy_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.read_validating_admission_policy_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_validating_admission_policy_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_validating_admission_policy_status # noqa: E501 + + read status of the specified ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_validating_admission_policy_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_validating_admission_policy_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_validating_admission_policy_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_validating_webhook_configuration(self, name, **kwargs): # noqa: E501 + """read_validating_webhook_configuration # noqa: E501 + + read the specified ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_validating_webhook_configuration(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingWebhookConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingWebhookConfiguration + """ + kwargs['_return_http_data_only'] = True + return self.read_validating_webhook_configuration_with_http_info(name, **kwargs) # noqa: E501 + + def read_validating_webhook_configuration_with_http_info(self, name, **kwargs): # noqa: E501 + """read_validating_webhook_configuration # noqa: E501 + + read the specified ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_validating_webhook_configuration_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingWebhookConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingWebhookConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_validating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_validating_webhook_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingWebhookConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_mutating_webhook_configuration(self, name, body, **kwargs): # noqa: E501 + """replace_mutating_webhook_configuration # noqa: E501 + + replace the specified MutatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_mutating_webhook_configuration(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingWebhookConfiguration (required) + :type name: str + :param body: (required) + :type body: V1MutatingWebhookConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1MutatingWebhookConfiguration + """ + kwargs['_return_http_data_only'] = True + return self.replace_mutating_webhook_configuration_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_mutating_webhook_configuration_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_mutating_webhook_configuration # noqa: E501 + + replace the specified MutatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_mutating_webhook_configuration_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingWebhookConfiguration (required) + :type name: str + :param body: (required) + :type body: V1MutatingWebhookConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1MutatingWebhookConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_mutating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_mutating_webhook_configuration`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_mutating_webhook_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1MutatingWebhookConfiguration", + 201: "V1MutatingWebhookConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_validating_admission_policy(self, name, body, **kwargs): # noqa: E501 + """replace_validating_admission_policy # noqa: E501 + + replace the specified ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_validating_admission_policy(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: V1ValidatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.replace_validating_admission_policy_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_validating_admission_policy_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_validating_admission_policy # noqa: E501 + + replace the specified ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_validating_admission_policy_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: V1ValidatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_validating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_validating_admission_policy`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_validating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingAdmissionPolicy", + 201: "V1ValidatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_validating_admission_policy_binding(self, name, body, **kwargs): # noqa: E501 + """replace_validating_admission_policy_binding # noqa: E501 + + replace the specified ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_validating_admission_policy_binding(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicyBinding (required) + :type name: str + :param body: (required) + :type body: V1ValidatingAdmissionPolicyBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingAdmissionPolicyBinding + """ + kwargs['_return_http_data_only'] = True + return self.replace_validating_admission_policy_binding_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_validating_admission_policy_binding_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_validating_admission_policy_binding # noqa: E501 + + replace the specified ValidatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_validating_admission_policy_binding_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicyBinding (required) + :type name: str + :param body: (required) + :type body: V1ValidatingAdmissionPolicyBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingAdmissionPolicyBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_validating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_validating_admission_policy_binding`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_validating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingAdmissionPolicyBinding", + 201: "V1ValidatingAdmissionPolicyBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicybindings/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_validating_admission_policy_status(self, name, body, **kwargs): # noqa: E501 + """replace_validating_admission_policy_status # noqa: E501 + + replace status of the specified ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_validating_admission_policy_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: V1ValidatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.replace_validating_admission_policy_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_validating_admission_policy_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_validating_admission_policy_status # noqa: E501 + + replace status of the specified ValidatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_validating_admission_policy_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: V1ValidatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_validating_admission_policy_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_validating_admission_policy_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_validating_admission_policy_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingAdmissionPolicy", + 201: "V1ValidatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingadmissionpolicies/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_validating_webhook_configuration(self, name, body, **kwargs): # noqa: E501 + """replace_validating_webhook_configuration # noqa: E501 + + replace the specified ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_validating_webhook_configuration(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingWebhookConfiguration (required) + :type name: str + :param body: (required) + :type body: V1ValidatingWebhookConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ValidatingWebhookConfiguration + """ + kwargs['_return_http_data_only'] = True + return self.replace_validating_webhook_configuration_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_validating_webhook_configuration_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_validating_webhook_configuration # noqa: E501 + + replace the specified ValidatingWebhookConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_validating_webhook_configuration_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ValidatingWebhookConfiguration (required) + :type name: str + :param body: (required) + :type body: V1ValidatingWebhookConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ValidatingWebhookConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_validating_webhook_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_validating_webhook_configuration`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_validating_webhook_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ValidatingWebhookConfiguration", + 201: "V1ValidatingWebhookConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/admissionregistration_v1alpha1_api.py b/kubernetes_asyncio/client/api/admissionregistration_v1alpha1_api.py new file mode 100644 index 0000000000..dd8a09a110 --- /dev/null +++ b/kubernetes_asyncio/client/api/admissionregistration_v1alpha1_api.py @@ -0,0 +1,2781 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AdmissionregistrationV1alpha1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_mutating_admission_policy(self, body, **kwargs): # noqa: E501 + """create_mutating_admission_policy # noqa: E501 + + create a MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_mutating_admission_policy(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1alpha1MutatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1MutatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.create_mutating_admission_policy_with_http_info(body, **kwargs) # noqa: E501 + + def create_mutating_admission_policy_with_http_info(self, body, **kwargs): # noqa: E501 + """create_mutating_admission_policy # noqa: E501 + + create a MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_mutating_admission_policy_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1alpha1MutatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1MutatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_mutating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1MutatingAdmissionPolicy", + 201: "V1alpha1MutatingAdmissionPolicy", + 202: "V1alpha1MutatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_mutating_admission_policy_binding(self, body, **kwargs): # noqa: E501 + """create_mutating_admission_policy_binding # noqa: E501 + + create a MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_mutating_admission_policy_binding(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1alpha1MutatingAdmissionPolicyBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1MutatingAdmissionPolicyBinding + """ + kwargs['_return_http_data_only'] = True + return self.create_mutating_admission_policy_binding_with_http_info(body, **kwargs) # noqa: E501 + + def create_mutating_admission_policy_binding_with_http_info(self, body, **kwargs): # noqa: E501 + """create_mutating_admission_policy_binding # noqa: E501 + + create a MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_mutating_admission_policy_binding_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1alpha1MutatingAdmissionPolicyBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1MutatingAdmissionPolicyBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_mutating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1MutatingAdmissionPolicyBinding", + 201: "V1alpha1MutatingAdmissionPolicyBinding", + 202: "V1alpha1MutatingAdmissionPolicyBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_mutating_admission_policy(self, **kwargs): # noqa: E501 + """delete_collection_mutating_admission_policy # noqa: E501 + + delete collection of MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_mutating_admission_policy(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_mutating_admission_policy_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_mutating_admission_policy_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_mutating_admission_policy # noqa: E501 + + delete collection of MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_mutating_admission_policy_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_mutating_admission_policy_binding(self, **kwargs): # noqa: E501 + """delete_collection_mutating_admission_policy_binding # noqa: E501 + + delete collection of MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_mutating_admission_policy_binding(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_mutating_admission_policy_binding_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_mutating_admission_policy_binding_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_mutating_admission_policy_binding # noqa: E501 + + delete collection of MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_mutating_admission_policy_binding_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_mutating_admission_policy(self, name, **kwargs): # noqa: E501 + """delete_mutating_admission_policy # noqa: E501 + + delete a MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_mutating_admission_policy(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_mutating_admission_policy_with_http_info(name, **kwargs) # noqa: E501 + + def delete_mutating_admission_policy_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_mutating_admission_policy # noqa: E501 + + delete a MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_mutating_admission_policy_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_mutating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_mutating_admission_policy_binding(self, name, **kwargs): # noqa: E501 + """delete_mutating_admission_policy_binding # noqa: E501 + + delete a MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_mutating_admission_policy_binding(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_mutating_admission_policy_binding_with_http_info(name, **kwargs) # noqa: E501 + + def delete_mutating_admission_policy_binding_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_mutating_admission_policy_binding # noqa: E501 + + delete a MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_mutating_admission_policy_binding_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_mutating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_mutating_admission_policy(self, **kwargs): # noqa: E501 + """list_mutating_admission_policy # noqa: E501 + + list or watch objects of kind MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_mutating_admission_policy(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1MutatingAdmissionPolicyList + """ + kwargs['_return_http_data_only'] = True + return self.list_mutating_admission_policy_with_http_info(**kwargs) # noqa: E501 + + def list_mutating_admission_policy_with_http_info(self, **kwargs): # noqa: E501 + """list_mutating_admission_policy # noqa: E501 + + list or watch objects of kind MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_mutating_admission_policy_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1MutatingAdmissionPolicyList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1MutatingAdmissionPolicyList", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_mutating_admission_policy_binding(self, **kwargs): # noqa: E501 + """list_mutating_admission_policy_binding # noqa: E501 + + list or watch objects of kind MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_mutating_admission_policy_binding(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1MutatingAdmissionPolicyBindingList + """ + kwargs['_return_http_data_only'] = True + return self.list_mutating_admission_policy_binding_with_http_info(**kwargs) # noqa: E501 + + def list_mutating_admission_policy_binding_with_http_info(self, **kwargs): # noqa: E501 + """list_mutating_admission_policy_binding # noqa: E501 + + list or watch objects of kind MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_mutating_admission_policy_binding_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1MutatingAdmissionPolicyBindingList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1MutatingAdmissionPolicyBindingList", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_mutating_admission_policy(self, name, body, **kwargs): # noqa: E501 + """patch_mutating_admission_policy # noqa: E501 + + partially update the specified MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_mutating_admission_policy(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1MutatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.patch_mutating_admission_policy_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_mutating_admission_policy_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_mutating_admission_policy # noqa: E501 + + partially update the specified MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_mutating_admission_policy_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1MutatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_mutating_admission_policy`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_mutating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1MutatingAdmissionPolicy", + 201: "V1alpha1MutatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_mutating_admission_policy_binding(self, name, body, **kwargs): # noqa: E501 + """patch_mutating_admission_policy_binding # noqa: E501 + + partially update the specified MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_mutating_admission_policy_binding(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1MutatingAdmissionPolicyBinding + """ + kwargs['_return_http_data_only'] = True + return self.patch_mutating_admission_policy_binding_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_mutating_admission_policy_binding_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_mutating_admission_policy_binding # noqa: E501 + + partially update the specified MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_mutating_admission_policy_binding_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1MutatingAdmissionPolicyBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_mutating_admission_policy_binding`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_mutating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1MutatingAdmissionPolicyBinding", + 201: "V1alpha1MutatingAdmissionPolicyBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_mutating_admission_policy(self, name, **kwargs): # noqa: E501 + """read_mutating_admission_policy # noqa: E501 + + read the specified MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_mutating_admission_policy(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1MutatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.read_mutating_admission_policy_with_http_info(name, **kwargs) # noqa: E501 + + def read_mutating_admission_policy_with_http_info(self, name, **kwargs): # noqa: E501 + """read_mutating_admission_policy # noqa: E501 + + read the specified MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_mutating_admission_policy_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1MutatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_mutating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1MutatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_mutating_admission_policy_binding(self, name, **kwargs): # noqa: E501 + """read_mutating_admission_policy_binding # noqa: E501 + + read the specified MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_mutating_admission_policy_binding(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1MutatingAdmissionPolicyBinding + """ + kwargs['_return_http_data_only'] = True + return self.read_mutating_admission_policy_binding_with_http_info(name, **kwargs) # noqa: E501 + + def read_mutating_admission_policy_binding_with_http_info(self, name, **kwargs): # noqa: E501 + """read_mutating_admission_policy_binding # noqa: E501 + + read the specified MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_mutating_admission_policy_binding_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1MutatingAdmissionPolicyBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_mutating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1MutatingAdmissionPolicyBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_mutating_admission_policy(self, name, body, **kwargs): # noqa: E501 + """replace_mutating_admission_policy # noqa: E501 + + replace the specified MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_mutating_admission_policy(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: V1alpha1MutatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1MutatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.replace_mutating_admission_policy_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_mutating_admission_policy_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_mutating_admission_policy # noqa: E501 + + replace the specified MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_mutating_admission_policy_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: V1alpha1MutatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1MutatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_mutating_admission_policy`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_mutating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1MutatingAdmissionPolicy", + 201: "V1alpha1MutatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicies/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_mutating_admission_policy_binding(self, name, body, **kwargs): # noqa: E501 + """replace_mutating_admission_policy_binding # noqa: E501 + + replace the specified MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_mutating_admission_policy_binding(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param body: (required) + :type body: V1alpha1MutatingAdmissionPolicyBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1MutatingAdmissionPolicyBinding + """ + kwargs['_return_http_data_only'] = True + return self.replace_mutating_admission_policy_binding_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_mutating_admission_policy_binding_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_mutating_admission_policy_binding # noqa: E501 + + replace the specified MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_mutating_admission_policy_binding_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param body: (required) + :type body: V1alpha1MutatingAdmissionPolicyBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1MutatingAdmissionPolicyBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_mutating_admission_policy_binding`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_mutating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1MutatingAdmissionPolicyBinding", + 201: "V1alpha1MutatingAdmissionPolicyBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1alpha1/mutatingadmissionpolicybindings/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/admissionregistration_v1beta1_api.py b/kubernetes_asyncio/client/api/admissionregistration_v1beta1_api.py new file mode 100644 index 0000000000..1ed714c3e3 --- /dev/null +++ b/kubernetes_asyncio/client/api/admissionregistration_v1beta1_api.py @@ -0,0 +1,2781 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AdmissionregistrationV1beta1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_mutating_admission_policy(self, body, **kwargs): # noqa: E501 + """create_mutating_admission_policy # noqa: E501 + + create a MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_mutating_admission_policy(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1MutatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1MutatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.create_mutating_admission_policy_with_http_info(body, **kwargs) # noqa: E501 + + def create_mutating_admission_policy_with_http_info(self, body, **kwargs): # noqa: E501 + """create_mutating_admission_policy # noqa: E501 + + create a MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_mutating_admission_policy_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1MutatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1MutatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_mutating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1MutatingAdmissionPolicy", + 201: "V1beta1MutatingAdmissionPolicy", + 202: "V1beta1MutatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_mutating_admission_policy_binding(self, body, **kwargs): # noqa: E501 + """create_mutating_admission_policy_binding # noqa: E501 + + create a MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_mutating_admission_policy_binding(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1MutatingAdmissionPolicyBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1MutatingAdmissionPolicyBinding + """ + kwargs['_return_http_data_only'] = True + return self.create_mutating_admission_policy_binding_with_http_info(body, **kwargs) # noqa: E501 + + def create_mutating_admission_policy_binding_with_http_info(self, body, **kwargs): # noqa: E501 + """create_mutating_admission_policy_binding # noqa: E501 + + create a MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_mutating_admission_policy_binding_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1MutatingAdmissionPolicyBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1MutatingAdmissionPolicyBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_mutating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1MutatingAdmissionPolicyBinding", + 201: "V1beta1MutatingAdmissionPolicyBinding", + 202: "V1beta1MutatingAdmissionPolicyBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_mutating_admission_policy(self, **kwargs): # noqa: E501 + """delete_collection_mutating_admission_policy # noqa: E501 + + delete collection of MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_mutating_admission_policy(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_mutating_admission_policy_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_mutating_admission_policy_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_mutating_admission_policy # noqa: E501 + + delete collection of MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_mutating_admission_policy_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_mutating_admission_policy_binding(self, **kwargs): # noqa: E501 + """delete_collection_mutating_admission_policy_binding # noqa: E501 + + delete collection of MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_mutating_admission_policy_binding(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_mutating_admission_policy_binding_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_mutating_admission_policy_binding_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_mutating_admission_policy_binding # noqa: E501 + + delete collection of MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_mutating_admission_policy_binding_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_mutating_admission_policy(self, name, **kwargs): # noqa: E501 + """delete_mutating_admission_policy # noqa: E501 + + delete a MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_mutating_admission_policy(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_mutating_admission_policy_with_http_info(name, **kwargs) # noqa: E501 + + def delete_mutating_admission_policy_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_mutating_admission_policy # noqa: E501 + + delete a MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_mutating_admission_policy_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_mutating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_mutating_admission_policy_binding(self, name, **kwargs): # noqa: E501 + """delete_mutating_admission_policy_binding # noqa: E501 + + delete a MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_mutating_admission_policy_binding(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_mutating_admission_policy_binding_with_http_info(name, **kwargs) # noqa: E501 + + def delete_mutating_admission_policy_binding_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_mutating_admission_policy_binding # noqa: E501 + + delete a MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_mutating_admission_policy_binding_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_mutating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_mutating_admission_policy(self, **kwargs): # noqa: E501 + """list_mutating_admission_policy # noqa: E501 + + list or watch objects of kind MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_mutating_admission_policy(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1MutatingAdmissionPolicyList + """ + kwargs['_return_http_data_only'] = True + return self.list_mutating_admission_policy_with_http_info(**kwargs) # noqa: E501 + + def list_mutating_admission_policy_with_http_info(self, **kwargs): # noqa: E501 + """list_mutating_admission_policy # noqa: E501 + + list or watch objects of kind MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_mutating_admission_policy_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1MutatingAdmissionPolicyList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1MutatingAdmissionPolicyList", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_mutating_admission_policy_binding(self, **kwargs): # noqa: E501 + """list_mutating_admission_policy_binding # noqa: E501 + + list or watch objects of kind MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_mutating_admission_policy_binding(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1MutatingAdmissionPolicyBindingList + """ + kwargs['_return_http_data_only'] = True + return self.list_mutating_admission_policy_binding_with_http_info(**kwargs) # noqa: E501 + + def list_mutating_admission_policy_binding_with_http_info(self, **kwargs): # noqa: E501 + """list_mutating_admission_policy_binding # noqa: E501 + + list or watch objects of kind MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_mutating_admission_policy_binding_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1MutatingAdmissionPolicyBindingList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1MutatingAdmissionPolicyBindingList", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_mutating_admission_policy(self, name, body, **kwargs): # noqa: E501 + """patch_mutating_admission_policy # noqa: E501 + + partially update the specified MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_mutating_admission_policy(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1MutatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.patch_mutating_admission_policy_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_mutating_admission_policy_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_mutating_admission_policy # noqa: E501 + + partially update the specified MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_mutating_admission_policy_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1MutatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_mutating_admission_policy`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_mutating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1MutatingAdmissionPolicy", + 201: "V1beta1MutatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_mutating_admission_policy_binding(self, name, body, **kwargs): # noqa: E501 + """patch_mutating_admission_policy_binding # noqa: E501 + + partially update the specified MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_mutating_admission_policy_binding(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1MutatingAdmissionPolicyBinding + """ + kwargs['_return_http_data_only'] = True + return self.patch_mutating_admission_policy_binding_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_mutating_admission_policy_binding_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_mutating_admission_policy_binding # noqa: E501 + + partially update the specified MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_mutating_admission_policy_binding_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1MutatingAdmissionPolicyBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_mutating_admission_policy_binding`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_mutating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1MutatingAdmissionPolicyBinding", + 201: "V1beta1MutatingAdmissionPolicyBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_mutating_admission_policy(self, name, **kwargs): # noqa: E501 + """read_mutating_admission_policy # noqa: E501 + + read the specified MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_mutating_admission_policy(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1MutatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.read_mutating_admission_policy_with_http_info(name, **kwargs) # noqa: E501 + + def read_mutating_admission_policy_with_http_info(self, name, **kwargs): # noqa: E501 + """read_mutating_admission_policy # noqa: E501 + + read the specified MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_mutating_admission_policy_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1MutatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_mutating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1MutatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_mutating_admission_policy_binding(self, name, **kwargs): # noqa: E501 + """read_mutating_admission_policy_binding # noqa: E501 + + read the specified MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_mutating_admission_policy_binding(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1MutatingAdmissionPolicyBinding + """ + kwargs['_return_http_data_only'] = True + return self.read_mutating_admission_policy_binding_with_http_info(name, **kwargs) # noqa: E501 + + def read_mutating_admission_policy_binding_with_http_info(self, name, **kwargs): # noqa: E501 + """read_mutating_admission_policy_binding # noqa: E501 + + read the specified MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_mutating_admission_policy_binding_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1MutatingAdmissionPolicyBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_mutating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1MutatingAdmissionPolicyBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_mutating_admission_policy(self, name, body, **kwargs): # noqa: E501 + """replace_mutating_admission_policy # noqa: E501 + + replace the specified MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_mutating_admission_policy(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: V1beta1MutatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1MutatingAdmissionPolicy + """ + kwargs['_return_http_data_only'] = True + return self.replace_mutating_admission_policy_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_mutating_admission_policy_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_mutating_admission_policy # noqa: E501 + + replace the specified MutatingAdmissionPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_mutating_admission_policy_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicy (required) + :type name: str + :param body: (required) + :type body: V1beta1MutatingAdmissionPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1MutatingAdmissionPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_mutating_admission_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_mutating_admission_policy`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_mutating_admission_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1MutatingAdmissionPolicy", + 201: "V1beta1MutatingAdmissionPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicies/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_mutating_admission_policy_binding(self, name, body, **kwargs): # noqa: E501 + """replace_mutating_admission_policy_binding # noqa: E501 + + replace the specified MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_mutating_admission_policy_binding(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param body: (required) + :type body: V1beta1MutatingAdmissionPolicyBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1MutatingAdmissionPolicyBinding + """ + kwargs['_return_http_data_only'] = True + return self.replace_mutating_admission_policy_binding_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_mutating_admission_policy_binding_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_mutating_admission_policy_binding # noqa: E501 + + replace the specified MutatingAdmissionPolicyBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_mutating_admission_policy_binding_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the MutatingAdmissionPolicyBinding (required) + :type name: str + :param body: (required) + :type body: V1beta1MutatingAdmissionPolicyBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1MutatingAdmissionPolicyBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_mutating_admission_policy_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_mutating_admission_policy_binding`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_mutating_admission_policy_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1MutatingAdmissionPolicyBinding", + 201: "V1beta1MutatingAdmissionPolicyBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/admissionregistration.k8s.io/v1beta1/mutatingadmissionpolicybindings/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/apiextensions_api.py b/kubernetes_asyncio/client/api/apiextensions_api.py new file mode 100644 index 0000000000..985c008553 --- /dev/null +++ b/kubernetes_asyncio/client/api/apiextensions_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class ApiextensionsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiextensions.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/apiextensions_v1_api.py b/kubernetes_asyncio/client/api/apiextensions_v1_api.py new file mode 100644 index 0000000000..14176121fc --- /dev/null +++ b/kubernetes_asyncio/client/api/apiextensions_v1_api.py @@ -0,0 +1,1987 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class ApiextensionsV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_custom_resource_definition(self, body, **kwargs): # noqa: E501 + """create_custom_resource_definition # noqa: E501 + + create a CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_custom_resource_definition(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1CustomResourceDefinition + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CustomResourceDefinition + """ + kwargs['_return_http_data_only'] = True + 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 + """create_custom_resource_definition # noqa: E501 + + create a CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_custom_resource_definition_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1CustomResourceDefinition + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CustomResourceDefinition, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_custom_resource_definition" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_custom_resource_definition`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CustomResourceDefinition", + 201: "V1CustomResourceDefinition", + 202: "V1CustomResourceDefinition", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_custom_resource_definition(self, **kwargs): # noqa: E501 + """delete_collection_custom_resource_definition # noqa: E501 + + delete collection of CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_custom_resource_definition(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + """delete_collection_custom_resource_definition # noqa: E501 + + delete collection of CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_custom_resource_definition_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_custom_resource_definition" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_custom_resource_definition(self, name, **kwargs): # noqa: E501 + """delete_custom_resource_definition # noqa: E501 + + delete a CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_custom_resource_definition(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + """delete_custom_resource_definition # noqa: E501 + + delete a CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_custom_resource_definition_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_custom_resource_definition" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_custom_resource_definition`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiextensions.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_custom_resource_definition(self, **kwargs): # noqa: E501 + """list_custom_resource_definition # noqa: E501 + + list or watch objects of kind CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_custom_resource_definition(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CustomResourceDefinitionList + """ + kwargs['_return_http_data_only'] = True + return self.list_custom_resource_definition_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_custom_resource_definition_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CustomResourceDefinitionList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_custom_resource_definition" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CustomResourceDefinitionList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_custom_resource_definition(self, name, body, **kwargs): # noqa: E501 + """patch_custom_resource_definition # noqa: E501 + + partially update the specified CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_custom_resource_definition(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CustomResourceDefinition + """ + kwargs['_return_http_data_only'] = True + 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 + """patch_custom_resource_definition # noqa: E501 + + partially update the specified CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_custom_resource_definition_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CustomResourceDefinition, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_custom_resource_definition" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_custom_resource_definition`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CustomResourceDefinition", + 201: "V1CustomResourceDefinition", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_custom_resource_definition_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CustomResourceDefinition + """ + kwargs['_return_http_data_only'] = True + 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 + """patch_custom_resource_definition_status # noqa: E501 + + partially update status of the specified CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_custom_resource_definition_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CustomResourceDefinition, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_custom_resource_definition_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_custom_resource_definition_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CustomResourceDefinition", + 201: "V1CustomResourceDefinition", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_custom_resource_definition(self, name, **kwargs): # noqa: E501 + """read_custom_resource_definition # noqa: E501 + + read the specified CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_custom_resource_definition(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CustomResourceDefinition + """ + kwargs['_return_http_data_only'] = True + 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 + """read_custom_resource_definition # noqa: E501 + + read the specified CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_custom_resource_definition_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CustomResourceDefinition, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_custom_resource_definition" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CustomResourceDefinition", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_custom_resource_definition_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CustomResourceDefinition + """ + kwargs['_return_http_data_only'] = True + 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 + + read status of the specified CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_custom_resource_definition_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CustomResourceDefinition, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_custom_resource_definition_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CustomResourceDefinition", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_custom_resource_definition(self, name, body, **kwargs): # noqa: E501 + """replace_custom_resource_definition # noqa: E501 + + replace the specified CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_custom_resource_definition(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param body: (required) + :type body: V1CustomResourceDefinition + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CustomResourceDefinition + """ + kwargs['_return_http_data_only'] = True + return self.replace_custom_resource_definition_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_custom_resource_definition_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_custom_resource_definition # noqa: E501 + + replace the specified CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_custom_resource_definition_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param body: (required) + :type body: V1CustomResourceDefinition + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CustomResourceDefinition, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_custom_resource_definition" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_custom_resource_definition`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_custom_resource_definition`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CustomResourceDefinition", + 201: "V1CustomResourceDefinition", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_custom_resource_definition_status(self, name, body, **kwargs): # noqa: E501 + """replace_custom_resource_definition_status # noqa: E501 + + replace status of the specified CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_custom_resource_definition_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param body: (required) + :type body: V1CustomResourceDefinition + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CustomResourceDefinition + """ + kwargs['_return_http_data_only'] = True + return self.replace_custom_resource_definition_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_custom_resource_definition_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_custom_resource_definition_status # noqa: E501 + + replace status of the specified CustomResourceDefinition # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_custom_resource_definition_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CustomResourceDefinition (required) + :type name: str + :param body: (required) + :type body: V1CustomResourceDefinition + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CustomResourceDefinition, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_custom_resource_definition_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_custom_resource_definition_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CustomResourceDefinition", + 201: "V1CustomResourceDefinition", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/apiregistration_api.py b/kubernetes_asyncio/client/api/apiregistration_api.py new file mode 100644 index 0000000000..dda860acfb --- /dev/null +++ b/kubernetes_asyncio/client/api/apiregistration_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class ApiregistrationApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiregistration.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/apiregistration_v1_api.py b/kubernetes_asyncio/client/api/apiregistration_v1_api.py new file mode 100644 index 0000000000..1366850cca --- /dev/null +++ b/kubernetes_asyncio/client/api/apiregistration_v1_api.py @@ -0,0 +1,1987 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class ApiregistrationV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_api_service(self, body, **kwargs): # noqa: E501 + """create_api_service # noqa: E501 + + create an APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_api_service(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1APIService + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIService + """ + kwargs['_return_http_data_only'] = True + return self.create_api_service_with_http_info(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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_api_service_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1APIService + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIService, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_api_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_api_service`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIService", + 201: "V1APIService", + 202: "V1APIService", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiregistration.k8s.io/v1/apiservices', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_api_service(self, name, **kwargs): # noqa: E501 + """delete_api_service # noqa: E501 + + delete an APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_api_service(name, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_api_service_with_http_info(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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_api_service_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_api_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_api_service`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiregistration.k8s.io/v1/apiservices/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_api_service(self, **kwargs): # noqa: E501 + """delete_collection_api_service # noqa: E501 + + delete collection of APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_api_service(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_api_service_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_api_service_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_api_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiregistration.k8s.io/v1/apiservices', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiregistration.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_api_service(self, **kwargs): # noqa: E501 + """list_api_service # noqa: E501 + + list or watch objects of kind APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_api_service(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIServiceList + """ + kwargs['_return_http_data_only'] = True + return self.list_api_service_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_api_service_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIServiceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_api_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIServiceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiregistration.k8s.io/v1/apiservices', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_api_service(self, name, body, **kwargs): # noqa: E501 + """patch_api_service # noqa: E501 + + partially update the specified APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_api_service(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIService + """ + kwargs['_return_http_data_only'] = True + 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 + """patch_api_service # noqa: E501 + + partially update the specified APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_api_service_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIService, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_api_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_api_service`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIService", + 201: "V1APIService", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiregistration.k8s.io/v1/apiservices/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_api_service_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIService + """ + kwargs['_return_http_data_only'] = True + 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 + """patch_api_service_status # noqa: E501 + + partially update status of the specified APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_api_service_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIService, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_api_service_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_api_service_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIService", + 201: "V1APIService", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_api_service(self, name, **kwargs): # noqa: E501 + """read_api_service # noqa: E501 + + read the specified APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_api_service(name, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIService + """ + kwargs['_return_http_data_only'] = True + return self.read_api_service_with_http_info(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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_api_service_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIService, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_api_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIService", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiregistration.k8s.io/v1/apiservices/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_api_service_status(self, name, **kwargs): # noqa: E501 + """read_api_service_status # noqa: E501 + + read status of the specified APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_api_service_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIService + """ + kwargs['_return_http_data_only'] = True + 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 + + read status of the specified APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_api_service_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIService, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_api_service_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_api_service_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIService", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_api_service(self, name, body, **kwargs): # noqa: E501 + """replace_api_service # noqa: E501 + + replace the specified APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_api_service(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param body: (required) + :type body: V1APIService + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIService + """ + kwargs['_return_http_data_only'] = True + return self.replace_api_service_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_api_service # noqa: E501 + + replace the specified APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_api_service_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param body: (required) + :type body: V1APIService + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIService, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_api_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_api_service`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_api_service`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIService", + 201: "V1APIService", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiregistration.k8s.io/v1/apiservices/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_api_service_status(self, name, body, **kwargs): # noqa: E501 + """replace_api_service_status # noqa: E501 + + replace status of the specified APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_api_service_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param body: (required) + :type body: V1APIService + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIService + """ + kwargs['_return_http_data_only'] = True + return self.replace_api_service_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_api_service_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_api_service_status # noqa: E501 + + replace status of the specified APIService # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_api_service_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the APIService (required) + :type name: str + :param body: (required) + :type body: V1APIService + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIService, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_api_service_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_api_service_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_api_service_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIService", + 201: "V1APIService", + 401: None, + } + + return self.api_client.call_api( + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/apis_api.py b/kubernetes_asyncio/client/api/apis_api.py new file mode 100644 index 0000000000..71e5048e63 --- /dev/null +++ b/kubernetes_asyncio/client/api/apis_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class ApisApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_versions(self, **kwargs): # noqa: E501 + """get_api_versions # noqa: E501 + + get available API versions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_versions(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroupList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_versions_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_versions_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroupList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_versions" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroupList", + 401: None, + } + + return self.api_client.call_api( + '/apis/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/apps_api.py b/kubernetes_asyncio/client/api/apps_api.py new file mode 100644 index 0000000000..7208ac5294 --- /dev/null +++ b/kubernetes_asyncio/client/api/apps_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AppsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/apps_v1_api.py b/kubernetes_asyncio/client/api/apps_v1_api.py new file mode 100644 index 0000000000..40ab85676f --- /dev/null +++ b/kubernetes_asyncio/client/api/apps_v1_api.py @@ -0,0 +1,11888 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AppsV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_namespaced_controller_revision(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_controller_revision # noqa: E501 + + create a ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_controller_revision(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ControllerRevision + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ControllerRevision + """ + kwargs['_return_http_data_only'] = True + 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 + """create_namespaced_controller_revision # noqa: E501 + + create a ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_controller_revision_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ControllerRevision + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ControllerRevision, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_controller_revision" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_controller_revision`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ControllerRevision", + 201: "V1ControllerRevision", + 202: "V1ControllerRevision", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_daemon_set(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_daemon_set # noqa: E501 + + create a DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_daemon_set(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1DaemonSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DaemonSet + """ + kwargs['_return_http_data_only'] = True + 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 + """create_namespaced_daemon_set # noqa: E501 + + create a DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_daemon_set_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1DaemonSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DaemonSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_daemon_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_daemon_set`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DaemonSet", + 201: "V1DaemonSet", + 202: "V1DaemonSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/daemonsets', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_deployment(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_deployment # noqa: E501 + + create a Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_deployment(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Deployment + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Deployment + """ + kwargs['_return_http_data_only'] = True + 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 + """create_namespaced_deployment # noqa: E501 + + create a Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_deployment_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Deployment + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Deployment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_deployment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_deployment`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Deployment", + 201: "V1Deployment", + 202: "V1Deployment", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/deployments', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_replica_set(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_replica_set # noqa: E501 + + create a ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_replica_set(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ReplicaSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicaSet + """ + kwargs['_return_http_data_only'] = True + 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 + """create_namespaced_replica_set # noqa: E501 + + create a ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_replica_set_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ReplicaSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicaSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_replica_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_replica_set`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicaSet", + 201: "V1ReplicaSet", + 202: "V1ReplicaSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/replicasets', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_stateful_set(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_stateful_set # noqa: E501 + + create a StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_stateful_set(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1StatefulSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StatefulSet + """ + kwargs['_return_http_data_only'] = True + 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 + """create_namespaced_stateful_set # noqa: E501 + + create a StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_stateful_set_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1StatefulSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StatefulSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_stateful_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_stateful_set`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StatefulSet", + 201: "V1StatefulSet", + 202: "V1StatefulSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/statefulsets', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_controller_revision(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_controller_revision # noqa: E501 + + delete collection of ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_controller_revision(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + """delete_collection_namespaced_controller_revision # noqa: E501 + + delete collection of ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_controller_revision_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_controller_revision" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_controller_revision`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_daemon_set(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_daemon_set # noqa: E501 + + delete collection of DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_daemon_set(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + """delete_collection_namespaced_daemon_set # noqa: E501 + + delete collection of DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_daemon_set_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_daemon_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_daemon_set`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/daemonsets', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_deployment(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_deployment # noqa: E501 + + delete collection of Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_deployment(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + + delete collection of Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_deployment_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_deployment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_deployment`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/deployments', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_replica_set(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_replica_set # noqa: E501 + + delete collection of ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_replica_set(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + + delete collection of ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_replica_set_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_replica_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_replica_set`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/replicasets', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_stateful_set(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_stateful_set # noqa: E501 + + delete collection of StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_stateful_set(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + """delete_collection_namespaced_stateful_set # noqa: E501 + + delete collection of StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_stateful_set_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_stateful_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_stateful_set`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/statefulsets', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_controller_revision(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_controller_revision # noqa: E501 + + delete a ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_controller_revision(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ControllerRevision (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + + delete a ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_controller_revision_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ControllerRevision (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_controller_revision" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_controller_revision`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_controller_revision`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_daemon_set(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_daemon_set # noqa: E501 + + delete a DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_daemon_set(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_daemon_set_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_daemon_set_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_daemon_set # noqa: E501 + + delete a DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_daemon_set_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_daemon_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_daemon_set`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_daemon_set`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_deployment(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_deployment # noqa: E501 + + delete a Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_deployment(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_deployment_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_deployment_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_deployment # noqa: E501 + + delete a Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_deployment_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_deployment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_deployment`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_deployment`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_replica_set(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_replica_set # noqa: E501 + + delete a ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_replica_set(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_replica_set_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_replica_set_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_replica_set # noqa: E501 + + delete a ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_replica_set_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_replica_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_replica_set`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_replica_set`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_stateful_set(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_stateful_set # noqa: E501 + + delete a StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_stateful_set(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_stateful_set_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_stateful_set_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_stateful_set # noqa: E501 + + delete a StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_stateful_set_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_stateful_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_stateful_set`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_stateful_set`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_controller_revision_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_controller_revision_for_all_namespaces # noqa: E501 + + list or watch objects of kind ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_controller_revision_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ControllerRevisionList + """ + kwargs['_return_http_data_only'] = True + return self.list_controller_revision_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_controller_revision_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_controller_revision_for_all_namespaces # noqa: E501 + + list or watch objects of kind ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_controller_revision_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ControllerRevisionList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_controller_revision_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ControllerRevisionList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/controllerrevisions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_daemon_set_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_daemon_set_for_all_namespaces # noqa: E501 + + list or watch objects of kind DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_daemon_set_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DaemonSetList + """ + kwargs['_return_http_data_only'] = True + return self.list_daemon_set_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_daemon_set_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_daemon_set_for_all_namespaces # noqa: E501 + + list or watch objects of kind DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_daemon_set_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DaemonSetList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_daemon_set_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DaemonSetList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/daemonsets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_deployment_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_deployment_for_all_namespaces # noqa: E501 + + list or watch objects of kind Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_deployment_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DeploymentList + """ + kwargs['_return_http_data_only'] = True + return self.list_deployment_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_deployment_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_deployment_for_all_namespaces # noqa: E501 + + list or watch objects of kind Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_deployment_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DeploymentList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_deployment_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DeploymentList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/deployments', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_controller_revision(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_controller_revision # noqa: E501 + + list or watch objects of kind ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_controller_revision(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ControllerRevisionList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_controller_revision_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_controller_revision_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_controller_revision # noqa: E501 + + list or watch objects of kind ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_controller_revision_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ControllerRevisionList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_controller_revision" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_controller_revision`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ControllerRevisionList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_daemon_set(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_daemon_set # noqa: E501 + + list or watch objects of kind DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_daemon_set(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DaemonSetList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_daemon_set_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_daemon_set_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_daemon_set # noqa: E501 + + list or watch objects of kind DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_daemon_set_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DaemonSetList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_daemon_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_daemon_set`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DaemonSetList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/daemonsets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_deployment(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_deployment # noqa: E501 + + list or watch objects of kind Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_deployment(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DeploymentList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_deployment_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_deployment_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_deployment # noqa: E501 + + list or watch objects of kind Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_deployment_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DeploymentList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_deployment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_deployment`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DeploymentList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/deployments', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_replica_set(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_replica_set # noqa: E501 + + list or watch objects of kind ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_replica_set(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicaSetList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_replica_set_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_replica_set_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_replica_set # noqa: E501 + + list or watch objects of kind ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_replica_set_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicaSetList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_replica_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_replica_set`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicaSetList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/replicasets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_stateful_set(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_stateful_set # noqa: E501 + + list or watch objects of kind StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_stateful_set(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StatefulSetList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_stateful_set_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_stateful_set_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_stateful_set # noqa: E501 + + list or watch objects of kind StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_stateful_set_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StatefulSetList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_stateful_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_stateful_set`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StatefulSetList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/statefulsets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_replica_set_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_replica_set_for_all_namespaces # noqa: E501 + + list or watch objects of kind ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_replica_set_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicaSetList + """ + kwargs['_return_http_data_only'] = True + return self.list_replica_set_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_replica_set_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_replica_set_for_all_namespaces # noqa: E501 + + list or watch objects of kind ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_replica_set_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicaSetList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_replica_set_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicaSetList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/replicasets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_stateful_set_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_stateful_set_for_all_namespaces # noqa: E501 + + list or watch objects of kind StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_stateful_set_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StatefulSetList + """ + kwargs['_return_http_data_only'] = True + return self.list_stateful_set_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_stateful_set_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_stateful_set_for_all_namespaces # noqa: E501 + + list or watch objects of kind StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_stateful_set_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StatefulSetList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_stateful_set_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StatefulSetList", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/statefulsets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_controller_revision(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_controller_revision # noqa: E501 + + partially update the specified ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_controller_revision(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ControllerRevision (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ControllerRevision + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_controller_revision_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_controller_revision_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_controller_revision # noqa: E501 + + partially update the specified ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_controller_revision_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ControllerRevision (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ControllerRevision, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_controller_revision" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_controller_revision`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_controller_revision`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_controller_revision`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ControllerRevision", + 201: "V1ControllerRevision", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_daemon_set(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_daemon_set # noqa: E501 + + partially update the specified DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_daemon_set(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DaemonSet + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_daemon_set_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_daemon_set_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_daemon_set # noqa: E501 + + partially update the specified DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_daemon_set_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DaemonSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_daemon_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_daemon_set`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_daemon_set`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_daemon_set`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DaemonSet", + 201: "V1DaemonSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_daemon_set_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_daemon_set_status # noqa: E501 + + partially update status of the specified DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_daemon_set_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DaemonSet + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_daemon_set_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_daemon_set_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_daemon_set_status # noqa: E501 + + partially update status of the specified DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_daemon_set_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DaemonSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_daemon_set_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_daemon_set_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_daemon_set_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_daemon_set_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DaemonSet", + 201: "V1DaemonSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_deployment(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_deployment # noqa: E501 + + partially update the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_deployment(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Deployment + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_deployment_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_deployment_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_deployment # noqa: E501 + + partially update the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_deployment_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Deployment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_deployment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_deployment`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_deployment`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_deployment`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Deployment", + 201: "V1Deployment", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_deployment_scale(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_deployment_scale # noqa: E501 + + partially update scale of the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_deployment_scale(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Scale + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_deployment_scale_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_deployment_scale_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_deployment_scale # noqa: E501 + + partially update scale of the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_deployment_scale_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Scale, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_deployment_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_deployment_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_deployment_scale`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_deployment_scale`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Scale", + 201: "V1Scale", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_deployment_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_deployment_status # noqa: E501 + + partially update status of the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_deployment_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Deployment + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_deployment_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_deployment_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_deployment_status # noqa: E501 + + partially update status of the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_deployment_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Deployment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_deployment_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_deployment_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_deployment_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_deployment_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Deployment", + 201: "V1Deployment", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_replica_set(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_replica_set # noqa: E501 + + partially update the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_replica_set(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicaSet + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_replica_set_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_replica_set_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_replica_set # noqa: E501 + + partially update the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_replica_set_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicaSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_replica_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_replica_set`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_replica_set`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_replica_set`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicaSet", + 201: "V1ReplicaSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_replica_set_scale(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_replica_set_scale # noqa: E501 + + partially update scale of the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_replica_set_scale(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Scale + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_replica_set_scale_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_replica_set_scale_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_replica_set_scale # noqa: E501 + + partially update scale of the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_replica_set_scale_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Scale, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_replica_set_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_replica_set_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_replica_set_scale`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_replica_set_scale`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Scale", + 201: "V1Scale", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_replica_set_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_replica_set_status # noqa: E501 + + partially update status of the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_replica_set_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicaSet + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_replica_set_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_replica_set_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_replica_set_status # noqa: E501 + + partially update status of the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_replica_set_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicaSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_replica_set_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_replica_set_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_replica_set_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_replica_set_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicaSet", + 201: "V1ReplicaSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_stateful_set(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_stateful_set # noqa: E501 + + partially update the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_stateful_set(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StatefulSet + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_stateful_set_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_stateful_set_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_stateful_set # noqa: E501 + + partially update the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_stateful_set_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StatefulSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_stateful_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_stateful_set`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_stateful_set`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_stateful_set`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StatefulSet", + 201: "V1StatefulSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_stateful_set_scale(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_stateful_set_scale # noqa: E501 + + partially update scale of the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_stateful_set_scale(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Scale + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_stateful_set_scale_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_stateful_set_scale_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_stateful_set_scale # noqa: E501 + + partially update scale of the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_stateful_set_scale_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Scale, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_stateful_set_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_stateful_set_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_stateful_set_scale`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_stateful_set_scale`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Scale", + 201: "V1Scale", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_stateful_set_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_stateful_set_status # noqa: E501 + + partially update status of the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_stateful_set_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StatefulSet + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_stateful_set_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_stateful_set_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_stateful_set_status # noqa: E501 + + partially update status of the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_stateful_set_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StatefulSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_stateful_set_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_stateful_set_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_stateful_set_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_stateful_set_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StatefulSet", + 201: "V1StatefulSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_controller_revision(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_controller_revision # noqa: E501 + + read the specified ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_controller_revision(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ControllerRevision (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ControllerRevision + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_controller_revision_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_controller_revision_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_controller_revision # noqa: E501 + + read the specified ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_controller_revision_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ControllerRevision (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ControllerRevision, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_controller_revision" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_controller_revision`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_controller_revision`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ControllerRevision", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_daemon_set(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_daemon_set # noqa: E501 + + read the specified DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_daemon_set(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DaemonSet + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_daemon_set_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_daemon_set_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_daemon_set # noqa: E501 + + read the specified DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_daemon_set_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DaemonSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_daemon_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_daemon_set`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_daemon_set`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DaemonSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_daemon_set_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_daemon_set_status # noqa: E501 + + read status of the specified DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_daemon_set_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DaemonSet + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_daemon_set_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_daemon_set_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_daemon_set_status # noqa: E501 + + read status of the specified DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_daemon_set_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DaemonSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_daemon_set_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_daemon_set_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_daemon_set_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DaemonSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_deployment(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_deployment # noqa: E501 + + read the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_deployment(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Deployment + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_deployment_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_deployment_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_deployment # noqa: E501 + + read the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_deployment_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Deployment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_deployment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_deployment`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_deployment`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Deployment", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_deployment_scale(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_deployment_scale # noqa: E501 + + read scale of the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_deployment_scale(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Scale + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_deployment_scale_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_deployment_scale_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_deployment_scale # noqa: E501 + + read scale of the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_deployment_scale_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Scale, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_deployment_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_deployment_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_deployment_scale`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Scale", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_deployment_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_deployment_status # noqa: E501 + + read status of the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_deployment_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Deployment + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_deployment_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_deployment_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_deployment_status # noqa: E501 + + read status of the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_deployment_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Deployment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_deployment_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_deployment_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_deployment_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Deployment", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_replica_set(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_replica_set # noqa: E501 + + read the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_replica_set(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicaSet + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_replica_set_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_replica_set_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_replica_set # noqa: E501 + + read the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_replica_set_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicaSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_replica_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_replica_set`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_replica_set`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicaSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_replica_set_scale(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_replica_set_scale # noqa: E501 + + read scale of the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_replica_set_scale(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Scale + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_replica_set_scale_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_replica_set_scale_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_replica_set_scale # noqa: E501 + + read scale of the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_replica_set_scale_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Scale, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_replica_set_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_replica_set_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_replica_set_scale`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Scale", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_replica_set_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_replica_set_status # noqa: E501 + + read status of the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_replica_set_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicaSet + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_replica_set_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_replica_set_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_replica_set_status # noqa: E501 + + read status of the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_replica_set_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicaSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_replica_set_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_replica_set_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_replica_set_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicaSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_stateful_set(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_stateful_set # noqa: E501 + + read the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_stateful_set(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StatefulSet + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_stateful_set_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_stateful_set_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_stateful_set # noqa: E501 + + read the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_stateful_set_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StatefulSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_stateful_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_stateful_set`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_stateful_set`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StatefulSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_stateful_set_scale(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_stateful_set_scale # noqa: E501 + + read scale of the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_stateful_set_scale(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Scale + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_stateful_set_scale_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_stateful_set_scale_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_stateful_set_scale # noqa: E501 + + read scale of the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_stateful_set_scale_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Scale, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_stateful_set_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_stateful_set_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_stateful_set_scale`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Scale", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_stateful_set_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_stateful_set_status # noqa: E501 + + read status of the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_stateful_set_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StatefulSet + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_stateful_set_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_stateful_set_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_stateful_set_status # noqa: E501 + + read status of the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_stateful_set_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StatefulSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_stateful_set_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_stateful_set_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_stateful_set_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StatefulSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_controller_revision(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_controller_revision # noqa: E501 + + replace the specified ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_controller_revision(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ControllerRevision (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ControllerRevision + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ControllerRevision + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_controller_revision_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_controller_revision_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_controller_revision # noqa: E501 + + replace the specified ControllerRevision # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_controller_revision_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ControllerRevision (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ControllerRevision + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ControllerRevision, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_controller_revision" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_controller_revision`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_controller_revision`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_controller_revision`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ControllerRevision", + 201: "V1ControllerRevision", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_daemon_set(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_daemon_set # noqa: E501 + + replace the specified DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_daemon_set(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1DaemonSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DaemonSet + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_daemon_set_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_daemon_set_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_daemon_set # noqa: E501 + + replace the specified DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_daemon_set_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1DaemonSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DaemonSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_daemon_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_daemon_set`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_daemon_set`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_daemon_set`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DaemonSet", + 201: "V1DaemonSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_daemon_set_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_daemon_set_status # noqa: E501 + + replace status of the specified DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_daemon_set_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1DaemonSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DaemonSet + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_daemon_set_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_daemon_set_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_daemon_set_status # noqa: E501 + + replace status of the specified DaemonSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_daemon_set_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DaemonSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1DaemonSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DaemonSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_daemon_set_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_daemon_set_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_daemon_set_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_daemon_set_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DaemonSet", + 201: "V1DaemonSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_deployment(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_deployment # noqa: E501 + + replace the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_deployment(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Deployment + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Deployment + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_deployment_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_deployment_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_deployment # noqa: E501 + + replace the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_deployment_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Deployment + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Deployment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_deployment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_deployment`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_deployment`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_deployment`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Deployment", + 201: "V1Deployment", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_deployment_scale(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_deployment_scale # noqa: E501 + + replace scale of the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_deployment_scale(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Scale + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Scale + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_deployment_scale_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_deployment_scale_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_deployment_scale # noqa: E501 + + replace scale of the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_deployment_scale_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Scale + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Scale, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_deployment_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_deployment_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_deployment_scale`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_deployment_scale`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Scale", + 201: "V1Scale", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_deployment_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_deployment_status # noqa: E501 + + replace status of the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_deployment_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Deployment + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Deployment + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_deployment_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_deployment_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_deployment_status # noqa: E501 + + replace status of the specified Deployment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_deployment_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Deployment (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Deployment + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Deployment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_deployment_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_deployment_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_deployment_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_deployment_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Deployment", + 201: "V1Deployment", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_replica_set(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_replica_set # noqa: E501 + + replace the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_replica_set(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ReplicaSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicaSet + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_replica_set_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_replica_set_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_replica_set # noqa: E501 + + replace the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_replica_set_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ReplicaSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicaSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_replica_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_replica_set`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_replica_set`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_replica_set`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicaSet", + 201: "V1ReplicaSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_replica_set_scale(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_replica_set_scale # noqa: E501 + + replace scale of the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_replica_set_scale(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Scale + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Scale + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_replica_set_scale_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_replica_set_scale_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_replica_set_scale # noqa: E501 + + replace scale of the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_replica_set_scale_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Scale + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Scale, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_replica_set_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_replica_set_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_replica_set_scale`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_replica_set_scale`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Scale", + 201: "V1Scale", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_replica_set_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_replica_set_status # noqa: E501 + + replace status of the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_replica_set_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ReplicaSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicaSet + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_replica_set_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_replica_set_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_replica_set_status # noqa: E501 + + replace status of the specified ReplicaSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_replica_set_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicaSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ReplicaSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicaSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_replica_set_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_replica_set_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_replica_set_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_replica_set_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicaSet", + 201: "V1ReplicaSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_stateful_set(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_stateful_set # noqa: E501 + + replace the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_stateful_set(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1StatefulSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StatefulSet + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_stateful_set_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_stateful_set_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_stateful_set # noqa: E501 + + replace the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_stateful_set_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1StatefulSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StatefulSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_stateful_set" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_stateful_set`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_stateful_set`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_stateful_set`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StatefulSet", + 201: "V1StatefulSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_stateful_set_scale(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_stateful_set_scale # noqa: E501 + + replace scale of the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_stateful_set_scale(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Scale + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Scale + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_stateful_set_scale_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_stateful_set_scale_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_stateful_set_scale # noqa: E501 + + replace scale of the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_stateful_set_scale_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Scale + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Scale, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_stateful_set_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_stateful_set_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_stateful_set_scale`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_stateful_set_scale`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Scale", + 201: "V1Scale", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_stateful_set_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_stateful_set_status # noqa: E501 + + replace status of the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_stateful_set_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1StatefulSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StatefulSet + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_stateful_set_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_stateful_set_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_stateful_set_status # noqa: E501 + + replace status of the specified StatefulSet # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_stateful_set_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StatefulSet (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1StatefulSet + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StatefulSet, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_stateful_set_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_stateful_set_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_stateful_set_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_stateful_set_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StatefulSet", + 201: "V1StatefulSet", + 401: None, + } + + return self.api_client.call_api( + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/authentication_api.py b/kubernetes_asyncio/client/api/authentication_api.py new file mode 100644 index 0000000000..ce2ac1e179 --- /dev/null +++ b/kubernetes_asyncio/client/api/authentication_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AuthenticationApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/authentication.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/authentication_v1_api.py b/kubernetes_asyncio/client/api/authentication_v1_api.py new file mode 100644 index 0000000000..d3b6564255 --- /dev/null +++ b/kubernetes_asyncio/client/api/authentication_v1_api.py @@ -0,0 +1,501 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AuthenticationV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_self_subject_review(self, body, **kwargs): # noqa: E501 + """create_self_subject_review # noqa: E501 + + create a SelfSubjectReview # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_self_subject_review(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1SelfSubjectReview + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1SelfSubjectReview + """ + kwargs['_return_http_data_only'] = True + return self.create_self_subject_review_with_http_info(body, **kwargs) # noqa: E501 + + def create_self_subject_review_with_http_info(self, body, **kwargs): # noqa: E501 + """create_self_subject_review # noqa: E501 + + create a SelfSubjectReview # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_self_subject_review_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1SelfSubjectReview + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1SelfSubjectReview, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_self_subject_review" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_self_subject_review`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1SelfSubjectReview", + 201: "V1SelfSubjectReview", + 202: "V1SelfSubjectReview", + 401: None, + } + + return self.api_client.call_api( + '/apis/authentication.k8s.io/v1/selfsubjectreviews', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_token_review(self, body, **kwargs): # noqa: E501 + """create_token_review # noqa: E501 + + create a TokenReview # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_token_review(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1TokenReview + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1TokenReview + """ + kwargs['_return_http_data_only'] = True + return self.create_token_review_with_http_info(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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_token_review_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1TokenReview + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1TokenReview, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_token_review" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_token_review`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1TokenReview", + 201: "V1TokenReview", + 202: "V1TokenReview", + 401: None, + } + + return self.api_client.call_api( + '/apis/authentication.k8s.io/v1/tokenreviews', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/authentication.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/authorization_api.py b/kubernetes_asyncio/client/api/authorization_api.py new file mode 100644 index 0000000000..9bf5317e52 --- /dev/null +++ b/kubernetes_asyncio/client/api/authorization_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AuthorizationApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/authorization.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/authorization_v1_api.py b/kubernetes_asyncio/client/api/authorization_v1_api.py new file mode 100644 index 0000000000..b0cfdb4017 --- /dev/null +++ b/kubernetes_asyncio/client/api/authorization_v1_api.py @@ -0,0 +1,847 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AuthorizationV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_local_subject_access_review(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1LocalSubjectAccessReview + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1LocalSubjectAccessReview + """ + kwargs['_return_http_data_only'] = True + 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 + """create_namespaced_local_subject_access_review # noqa: E501 + + create a LocalSubjectAccessReview # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_local_subject_access_review_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1LocalSubjectAccessReview + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1LocalSubjectAccessReview, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_local_subject_access_review" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_local_subject_access_review`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1LocalSubjectAccessReview", + 201: "V1LocalSubjectAccessReview", + 202: "V1LocalSubjectAccessReview", + 401: None, + } + + return self.api_client.call_api( + '/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_self_subject_access_review(self, body, **kwargs): # noqa: E501 + """create_self_subject_access_review # noqa: E501 + + create a SelfSubjectAccessReview # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_self_subject_access_review(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1SelfSubjectAccessReview + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1SelfSubjectAccessReview + """ + kwargs['_return_http_data_only'] = True + 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 + """create_self_subject_access_review # noqa: E501 + + create a SelfSubjectAccessReview # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_self_subject_access_review_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1SelfSubjectAccessReview + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1SelfSubjectAccessReview, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_self_subject_access_review" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_self_subject_access_review`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1SelfSubjectAccessReview", + 201: "V1SelfSubjectAccessReview", + 202: "V1SelfSubjectAccessReview", + 401: None, + } + + return self.api_client.call_api( + '/apis/authorization.k8s.io/v1/selfsubjectaccessreviews', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_self_subject_rules_review(self, body, **kwargs): # noqa: E501 + """create_self_subject_rules_review # noqa: E501 + + create a SelfSubjectRulesReview # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_self_subject_rules_review(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1SelfSubjectRulesReview + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1SelfSubjectRulesReview + """ + kwargs['_return_http_data_only'] = True + 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 + """create_self_subject_rules_review # noqa: E501 + + create a SelfSubjectRulesReview # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_self_subject_rules_review_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1SelfSubjectRulesReview + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1SelfSubjectRulesReview, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_self_subject_rules_review" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_self_subject_rules_review`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1SelfSubjectRulesReview", + 201: "V1SelfSubjectRulesReview", + 202: "V1SelfSubjectRulesReview", + 401: None, + } + + return self.api_client.call_api( + '/apis/authorization.k8s.io/v1/selfsubjectrulesreviews', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_subject_access_review(self, body, **kwargs): # noqa: E501 + """create_subject_access_review # noqa: E501 + + create a SubjectAccessReview # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_subject_access_review(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1SubjectAccessReview + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1SubjectAccessReview + """ + kwargs['_return_http_data_only'] = True + 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 + """create_subject_access_review # noqa: E501 + + create a SubjectAccessReview # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_subject_access_review_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1SubjectAccessReview + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1SubjectAccessReview, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_subject_access_review" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_subject_access_review`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1SubjectAccessReview", + 201: "V1SubjectAccessReview", + 202: "V1SubjectAccessReview", + 401: None, + } + + return self.api_client.call_api( + '/apis/authorization.k8s.io/v1/subjectaccessreviews', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/authorization.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/autoscaling_api.py b/kubernetes_asyncio/client/api/autoscaling_api.py new file mode 100644 index 0000000000..2f0360eda5 --- /dev/null +++ b/kubernetes_asyncio/client/api/autoscaling_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AutoscalingApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/autoscaling_v1_api.py b/kubernetes_asyncio/client/api/autoscaling_v1_api.py new file mode 100644 index 0000000000..8e0cb112cb --- /dev/null +++ b/kubernetes_asyncio/client/api/autoscaling_v1_api.py @@ -0,0 +1,2292 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AutoscalingV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_namespaced_horizontal_pod_autoscaler(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_horizontal_pod_autoscaler # noqa: E501 + + create a HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_horizontal_pod_autoscaler(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1HorizontalPodAutoscaler + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + 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 + """create_namespaced_horizontal_pod_autoscaler # noqa: E501 + + create a HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1HorizontalPodAutoscaler + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1HorizontalPodAutoscaler", + 201: "V1HorizontalPodAutoscaler", + 202: "V1HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_horizontal_pod_autoscaler(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + """delete_collection_namespaced_horizontal_pod_autoscaler # noqa: E501 + + delete collection of HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_horizontal_pod_autoscaler # noqa: E501 + + delete a HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_horizontal_pod_autoscaler(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + """delete_namespaced_horizontal_pod_autoscaler # noqa: E501 + + delete a HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_horizontal_pod_autoscaler_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1HorizontalPodAutoscalerList + """ + kwargs['_return_http_data_only'] = True + 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 + """list_horizontal_pod_autoscaler_for_all_namespaces # noqa: E501 + + list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1HorizontalPodAutoscalerList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_horizontal_pod_autoscaler_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1HorizontalPodAutoscalerList", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v1/horizontalpodautoscalers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_horizontal_pod_autoscaler(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1HorizontalPodAutoscalerList + """ + kwargs['_return_http_data_only'] = True + 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 + """list_namespaced_horizontal_pod_autoscaler # noqa: E501 + + list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1HorizontalPodAutoscalerList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1HorizontalPodAutoscalerList", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_horizontal_pod_autoscaler(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + 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 + """patch_namespaced_horizontal_pod_autoscaler # noqa: E501 + + partially update the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1HorizontalPodAutoscaler", + 201: "V1HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_horizontal_pod_autoscaler_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + 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 + + partially update status of the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_horizontal_pod_autoscaler_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_horizontal_pod_autoscaler_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_horizontal_pod_autoscaler_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1HorizontalPodAutoscaler", + 201: "V1HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_horizontal_pod_autoscaler(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + 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 + + read the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_horizontal_pod_autoscaler_status # noqa: E501 + + read status of the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_horizontal_pod_autoscaler_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_horizontal_pod_autoscaler_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_horizontal_pod_autoscaler_status # noqa: E501 + + read status of the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_horizontal_pod_autoscaler_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_horizontal_pod_autoscaler_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_horizontal_pod_autoscaler # noqa: E501 + + replace the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_horizontal_pod_autoscaler(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1HorizontalPodAutoscaler + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_horizontal_pod_autoscaler # noqa: E501 + + replace the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1HorizontalPodAutoscaler + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1HorizontalPodAutoscaler", + 201: "V1HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_horizontal_pod_autoscaler_status # noqa: E501 + + replace status of the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_horizontal_pod_autoscaler_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1HorizontalPodAutoscaler + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_horizontal_pod_autoscaler_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_horizontal_pod_autoscaler_status # noqa: E501 + + replace status of the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1HorizontalPodAutoscaler + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_horizontal_pod_autoscaler_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_horizontal_pod_autoscaler_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_horizontal_pod_autoscaler_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1HorizontalPodAutoscaler", + 201: "V1HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/autoscaling_v2_api.py b/kubernetes_asyncio/client/api/autoscaling_v2_api.py new file mode 100644 index 0000000000..8b9ae92a4a --- /dev/null +++ b/kubernetes_asyncio/client/api/autoscaling_v2_api.py @@ -0,0 +1,2292 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class AutoscalingV2Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_namespaced_horizontal_pod_autoscaler(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_horizontal_pod_autoscaler # noqa: E501 + + create a HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_horizontal_pod_autoscaler(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V2HorizontalPodAutoscaler + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V2HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + 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 + """create_namespaced_horizontal_pod_autoscaler # noqa: E501 + + create a HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V2HorizontalPodAutoscaler + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V2HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V2HorizontalPodAutoscaler", + 201: "V2HorizontalPodAutoscaler", + 202: "V2HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_horizontal_pod_autoscaler(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + """delete_collection_namespaced_horizontal_pod_autoscaler # noqa: E501 + + delete collection of HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_horizontal_pod_autoscaler # noqa: E501 + + delete a HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_horizontal_pod_autoscaler(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + 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 + """delete_namespaced_horizontal_pod_autoscaler # noqa: E501 + + delete a HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v2/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_horizontal_pod_autoscaler_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V2HorizontalPodAutoscalerList + """ + kwargs['_return_http_data_only'] = True + 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 + """list_horizontal_pod_autoscaler_for_all_namespaces # noqa: E501 + + list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V2HorizontalPodAutoscalerList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_horizontal_pod_autoscaler_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V2HorizontalPodAutoscalerList", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v2/horizontalpodautoscalers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_horizontal_pod_autoscaler(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V2HorizontalPodAutoscalerList + """ + kwargs['_return_http_data_only'] = True + 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 + """list_namespaced_horizontal_pod_autoscaler # noqa: E501 + + list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V2HorizontalPodAutoscalerList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V2HorizontalPodAutoscalerList", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_horizontal_pod_autoscaler(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V2HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + 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 + """patch_namespaced_horizontal_pod_autoscaler # noqa: E501 + + partially update the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V2HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V2HorizontalPodAutoscaler", + 201: "V2HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_horizontal_pod_autoscaler_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V2HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + 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 + + partially update status of the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V2HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_horizontal_pod_autoscaler_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_horizontal_pod_autoscaler_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_horizontal_pod_autoscaler_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V2HorizontalPodAutoscaler", + 201: "V2HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + 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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_horizontal_pod_autoscaler(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V2HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + 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 + + read the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V2HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V2HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_horizontal_pod_autoscaler_status # noqa: E501 + + read status of the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_horizontal_pod_autoscaler_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V2HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_horizontal_pod_autoscaler_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_horizontal_pod_autoscaler_status # noqa: E501 + + read status of the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V2HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_horizontal_pod_autoscaler_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_horizontal_pod_autoscaler_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V2HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_horizontal_pod_autoscaler # noqa: E501 + + replace the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_horizontal_pod_autoscaler(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V2HorizontalPodAutoscaler + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V2HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_horizontal_pod_autoscaler # noqa: E501 + + replace the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V2HorizontalPodAutoscaler + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V2HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_horizontal_pod_autoscaler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_horizontal_pod_autoscaler`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V2HorizontalPodAutoscaler", + 201: "V2HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_horizontal_pod_autoscaler_status # noqa: E501 + + replace status of the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_horizontal_pod_autoscaler_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V2HorizontalPodAutoscaler + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V2HorizontalPodAutoscaler + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_horizontal_pod_autoscaler_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_horizontal_pod_autoscaler_status # noqa: E501 + + replace status of the specified HorizontalPodAutoscaler # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the HorizontalPodAutoscaler (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V2HorizontalPodAutoscaler + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V2HorizontalPodAutoscaler, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_horizontal_pod_autoscaler_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_horizontal_pod_autoscaler_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_horizontal_pod_autoscaler_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_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 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V2HorizontalPodAutoscaler", + 201: "V2HorizontalPodAutoscaler", + 401: None, + } + + return self.api_client.call_api( + '/apis/autoscaling/v2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/batch_api.py b/kubernetes_asyncio/client/api/batch_api.py new file mode 100644 index 0000000000..d0f817c03f --- /dev/null +++ b/kubernetes_asyncio/client/api/batch_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class BatchApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/batch_v1_api.py b/kubernetes_asyncio/client/api/batch_v1_api.py new file mode 100644 index 0000000000..fbba24ab3e --- /dev/null +++ b/kubernetes_asyncio/client/api/batch_v1_api.py @@ -0,0 +1,4419 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class BatchV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_namespaced_cron_job(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_cron_job # noqa: E501 + + create a CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_cron_job(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1CronJob + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CronJob + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_cron_job_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_cron_job_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_cron_job # noqa: E501 + + create a CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_cron_job_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1CronJob + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CronJob, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_cron_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_cron_job`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_cron_job`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CronJob", + 201: "V1CronJob", + 202: "V1CronJob", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/cronjobs', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_job(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_job # noqa: E501 + + create a Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_job(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Job + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Job + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_job_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_job_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_job # noqa: E501 + + create a Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_job_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Job + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Job, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_job`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_job`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Job", + 201: "V1Job", + 202: "V1Job", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/jobs', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_cron_job(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_cron_job # noqa: E501 + + delete collection of CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_cron_job(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_cron_job_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_cron_job_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_cron_job # noqa: E501 + + delete collection of CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_cron_job_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_cron_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_cron_job`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/cronjobs', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_job(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_job # noqa: E501 + + delete collection of Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_job(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_job_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_job_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_job # noqa: E501 + + delete collection of Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_job_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_job`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/jobs', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_cron_job(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_cron_job # noqa: E501 + + delete a CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_cron_job(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_cron_job_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_cron_job_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_cron_job # noqa: E501 + + delete a CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_cron_job_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_cron_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_cron_job`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_cron_job`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_job(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_job # noqa: E501 + + delete a Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_job(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_job_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_job_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_job # noqa: E501 + + delete a Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_job_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_job`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_job`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_cron_job_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_cron_job_for_all_namespaces # noqa: E501 + + list or watch objects of kind CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_cron_job_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CronJobList + """ + kwargs['_return_http_data_only'] = True + return self.list_cron_job_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_cron_job_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_cron_job_for_all_namespaces # noqa: E501 + + list or watch objects of kind CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_cron_job_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CronJobList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_cron_job_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CronJobList", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/cronjobs', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_job_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_job_for_all_namespaces # noqa: E501 + + list or watch objects of kind Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_job_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1JobList + """ + kwargs['_return_http_data_only'] = True + return self.list_job_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_job_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_job_for_all_namespaces # noqa: E501 + + list or watch objects of kind Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_job_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1JobList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_job_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1JobList", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/jobs', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_cron_job(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_cron_job # noqa: E501 + + list or watch objects of kind CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_cron_job(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CronJobList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_cron_job_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_cron_job_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_cron_job # noqa: E501 + + list or watch objects of kind CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_cron_job_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CronJobList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_cron_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_cron_job`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CronJobList", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/cronjobs', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_job(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_job # noqa: E501 + + list or watch objects of kind Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_job(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1JobList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_job_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_job_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_job # noqa: E501 + + list or watch objects of kind Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_job_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1JobList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_job`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1JobList", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/jobs', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_cron_job(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_cron_job # noqa: E501 + + partially update the specified CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_cron_job(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CronJob + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_cron_job_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_cron_job_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_cron_job # noqa: E501 + + partially update the specified CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_cron_job_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CronJob, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_cron_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_cron_job`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_cron_job`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_cron_job`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CronJob", + 201: "V1CronJob", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_cron_job_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_cron_job_status # noqa: E501 + + partially update status of the specified CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_cron_job_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CronJob + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_cron_job_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_cron_job_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_cron_job_status # noqa: E501 + + partially update status of the specified CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_cron_job_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CronJob, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_cron_job_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_cron_job_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_cron_job_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_cron_job_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CronJob", + 201: "V1CronJob", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_job(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_job # noqa: E501 + + partially update the specified Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_job(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Job + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_job_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_job_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_job # noqa: E501 + + partially update the specified Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_job_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Job, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_job`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_job`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_job`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Job", + 201: "V1Job", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_job_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_job_status # noqa: E501 + + partially update status of the specified Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_job_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Job + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_job_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_job_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_job_status # noqa: E501 + + partially update status of the specified Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_job_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Job, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_job_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_job_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_job_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_job_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Job", + 201: "V1Job", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_cron_job(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_cron_job # noqa: E501 + + read the specified CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_cron_job(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CronJob + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_cron_job_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_cron_job_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_cron_job # noqa: E501 + + read the specified CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_cron_job_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CronJob, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_cron_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_cron_job`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_cron_job`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CronJob", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_cron_job_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_cron_job_status # noqa: E501 + + read status of the specified CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_cron_job_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CronJob + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_cron_job_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_cron_job_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_cron_job_status # noqa: E501 + + read status of the specified CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_cron_job_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CronJob, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_cron_job_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_cron_job_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_cron_job_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CronJob", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_job(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_job # noqa: E501 + + read the specified Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_job(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Job + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_job_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_job_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_job # noqa: E501 + + read the specified Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_job_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Job, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_job`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_job`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Job", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_job_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_job_status # noqa: E501 + + read status of the specified Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_job_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Job + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_job_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_job_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_job_status # noqa: E501 + + read status of the specified Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_job_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Job, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_job_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_job_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_job_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Job", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_cron_job(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_cron_job # noqa: E501 + + replace the specified CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_cron_job(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1CronJob + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CronJob + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_cron_job_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_cron_job_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_cron_job # noqa: E501 + + replace the specified CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_cron_job_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1CronJob + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CronJob, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_cron_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_cron_job`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_cron_job`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_cron_job`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CronJob", + 201: "V1CronJob", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_cron_job_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_cron_job_status # noqa: E501 + + replace status of the specified CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_cron_job_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1CronJob + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CronJob + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_cron_job_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_cron_job_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_cron_job_status # noqa: E501 + + replace status of the specified CronJob # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_cron_job_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CronJob (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1CronJob + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CronJob, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_cron_job_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_cron_job_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_cron_job_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_cron_job_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CronJob", + 201: "V1CronJob", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_job(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_job # noqa: E501 + + replace the specified Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_job(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Job + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Job + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_job_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_job_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_job # noqa: E501 + + replace the specified Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_job_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Job + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Job, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_job" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_job`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_job`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_job`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Job", + 201: "V1Job", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_job_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_job_status # noqa: E501 + + replace status of the specified Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_job_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Job + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Job + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_job_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_job_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_job_status # noqa: E501 + + replace status of the specified Job # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_job_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Job (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Job + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Job, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_job_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_job_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_job_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_job_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Job", + 201: "V1Job", + 401: None, + } + + return self.api_client.call_api( + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/certificates_api.py b/kubernetes_asyncio/client/api/certificates_api.py new file mode 100644 index 0000000000..2f608fbdd6 --- /dev/null +++ b/kubernetes_asyncio/client/api/certificates_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CertificatesApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/certificates_v1_api.py b/kubernetes_asyncio/client/api/certificates_v1_api.py new file mode 100644 index 0000000000..41d3e89fd2 --- /dev/null +++ b/kubernetes_asyncio/client/api/certificates_v1_api.py @@ -0,0 +1,2501 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CertificatesV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_certificate_signing_request(self, body, **kwargs): # noqa: E501 + """create_certificate_signing_request # noqa: E501 + + create a CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_certificate_signing_request(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1CertificateSigningRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CertificateSigningRequest + """ + kwargs['_return_http_data_only'] = True + return self.create_certificate_signing_request_with_http_info(body, **kwargs) # noqa: E501 + + def create_certificate_signing_request_with_http_info(self, body, **kwargs): # noqa: E501 + """create_certificate_signing_request # noqa: E501 + + create a CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_certificate_signing_request_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1CertificateSigningRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CertificateSigningRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_certificate_signing_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_certificate_signing_request`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CertificateSigningRequest", + 201: "V1CertificateSigningRequest", + 202: "V1CertificateSigningRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/certificatesigningrequests', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_certificate_signing_request(self, name, **kwargs): # noqa: E501 + """delete_certificate_signing_request # noqa: E501 + + delete a CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_certificate_signing_request(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_certificate_signing_request_with_http_info(name, **kwargs) # noqa: E501 + + def delete_certificate_signing_request_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_certificate_signing_request # noqa: E501 + + delete a CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_certificate_signing_request_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_certificate_signing_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_certificate_signing_request`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_certificate_signing_request(self, **kwargs): # noqa: E501 + """delete_collection_certificate_signing_request # noqa: E501 + + delete collection of CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_certificate_signing_request(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_certificate_signing_request_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_certificate_signing_request_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_certificate_signing_request # noqa: E501 + + delete collection of CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_certificate_signing_request_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_certificate_signing_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/certificatesigningrequests', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_certificate_signing_request(self, **kwargs): # noqa: E501 + """list_certificate_signing_request # noqa: E501 + + list or watch objects of kind CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_certificate_signing_request(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CertificateSigningRequestList + """ + kwargs['_return_http_data_only'] = True + return self.list_certificate_signing_request_with_http_info(**kwargs) # noqa: E501 + + def list_certificate_signing_request_with_http_info(self, **kwargs): # noqa: E501 + """list_certificate_signing_request # noqa: E501 + + list or watch objects of kind CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_certificate_signing_request_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CertificateSigningRequestList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_certificate_signing_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CertificateSigningRequestList", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/certificatesigningrequests', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_certificate_signing_request(self, name, body, **kwargs): # noqa: E501 + """patch_certificate_signing_request # noqa: E501 + + partially update the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_certificate_signing_request(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CertificateSigningRequest + """ + kwargs['_return_http_data_only'] = True + return self.patch_certificate_signing_request_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_certificate_signing_request_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_certificate_signing_request # noqa: E501 + + partially update the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_certificate_signing_request_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CertificateSigningRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_certificate_signing_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_certificate_signing_request`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_certificate_signing_request`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CertificateSigningRequest", + 201: "V1CertificateSigningRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_certificate_signing_request_approval(self, name, body, **kwargs): # noqa: E501 + """patch_certificate_signing_request_approval # noqa: E501 + + partially update approval of the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_certificate_signing_request_approval(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CertificateSigningRequest + """ + kwargs['_return_http_data_only'] = True + return self.patch_certificate_signing_request_approval_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_certificate_signing_request_approval_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_certificate_signing_request_approval # noqa: E501 + + partially update approval of the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_certificate_signing_request_approval_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CertificateSigningRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_certificate_signing_request_approval" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_certificate_signing_request_approval`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_certificate_signing_request_approval`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CertificateSigningRequest", + 201: "V1CertificateSigningRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_certificate_signing_request_status(self, name, body, **kwargs): # noqa: E501 + """patch_certificate_signing_request_status # noqa: E501 + + partially update status of the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_certificate_signing_request_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CertificateSigningRequest + """ + kwargs['_return_http_data_only'] = True + return self.patch_certificate_signing_request_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_certificate_signing_request_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_certificate_signing_request_status # noqa: E501 + + partially update status of the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_certificate_signing_request_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CertificateSigningRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_certificate_signing_request_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_certificate_signing_request_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_certificate_signing_request_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CertificateSigningRequest", + 201: "V1CertificateSigningRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_certificate_signing_request(self, name, **kwargs): # noqa: E501 + """read_certificate_signing_request # noqa: E501 + + read the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_certificate_signing_request(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CertificateSigningRequest + """ + kwargs['_return_http_data_only'] = True + return self.read_certificate_signing_request_with_http_info(name, **kwargs) # noqa: E501 + + def read_certificate_signing_request_with_http_info(self, name, **kwargs): # noqa: E501 + """read_certificate_signing_request # noqa: E501 + + read the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_certificate_signing_request_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CertificateSigningRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_certificate_signing_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_certificate_signing_request`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CertificateSigningRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_certificate_signing_request_approval(self, name, **kwargs): # noqa: E501 + """read_certificate_signing_request_approval # noqa: E501 + + read approval of the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_certificate_signing_request_approval(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CertificateSigningRequest + """ + kwargs['_return_http_data_only'] = True + return self.read_certificate_signing_request_approval_with_http_info(name, **kwargs) # noqa: E501 + + def read_certificate_signing_request_approval_with_http_info(self, name, **kwargs): # noqa: E501 + """read_certificate_signing_request_approval # noqa: E501 + + read approval of the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_certificate_signing_request_approval_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CertificateSigningRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_certificate_signing_request_approval" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_certificate_signing_request_approval`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CertificateSigningRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_certificate_signing_request_status(self, name, **kwargs): # noqa: E501 + """read_certificate_signing_request_status # noqa: E501 + + read status of the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_certificate_signing_request_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CertificateSigningRequest + """ + kwargs['_return_http_data_only'] = True + return self.read_certificate_signing_request_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_certificate_signing_request_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_certificate_signing_request_status # noqa: E501 + + read status of the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_certificate_signing_request_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CertificateSigningRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_certificate_signing_request_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_certificate_signing_request_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CertificateSigningRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_certificate_signing_request(self, name, body, **kwargs): # noqa: E501 + """replace_certificate_signing_request # noqa: E501 + + replace the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_certificate_signing_request(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param body: (required) + :type body: V1CertificateSigningRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CertificateSigningRequest + """ + kwargs['_return_http_data_only'] = True + return self.replace_certificate_signing_request_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_certificate_signing_request_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_certificate_signing_request # noqa: E501 + + replace the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_certificate_signing_request_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param body: (required) + :type body: V1CertificateSigningRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CertificateSigningRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_certificate_signing_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_certificate_signing_request`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_certificate_signing_request`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CertificateSigningRequest", + 201: "V1CertificateSigningRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_certificate_signing_request_approval(self, name, body, **kwargs): # noqa: E501 + """replace_certificate_signing_request_approval # noqa: E501 + + replace approval of the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_certificate_signing_request_approval(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param body: (required) + :type body: V1CertificateSigningRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CertificateSigningRequest + """ + kwargs['_return_http_data_only'] = True + return self.replace_certificate_signing_request_approval_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_certificate_signing_request_approval_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_certificate_signing_request_approval # noqa: E501 + + replace approval of the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_certificate_signing_request_approval_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param body: (required) + :type body: V1CertificateSigningRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CertificateSigningRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_certificate_signing_request_approval" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_certificate_signing_request_approval`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_certificate_signing_request_approval`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CertificateSigningRequest", + 201: "V1CertificateSigningRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_certificate_signing_request_status(self, name, body, **kwargs): # noqa: E501 + """replace_certificate_signing_request_status # noqa: E501 + + replace status of the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_certificate_signing_request_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param body: (required) + :type body: V1CertificateSigningRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CertificateSigningRequest + """ + kwargs['_return_http_data_only'] = True + return self.replace_certificate_signing_request_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_certificate_signing_request_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_certificate_signing_request_status # noqa: E501 + + replace status of the specified CertificateSigningRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_certificate_signing_request_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CertificateSigningRequest (required) + :type name: str + :param body: (required) + :type body: V1CertificateSigningRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CertificateSigningRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_certificate_signing_request_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_certificate_signing_request_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_certificate_signing_request_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CertificateSigningRequest", + 201: "V1CertificateSigningRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/certificates_v1alpha1_api.py b/kubernetes_asyncio/client/api/certificates_v1alpha1_api.py new file mode 100644 index 0000000000..022d42db19 --- /dev/null +++ b/kubernetes_asyncio/client/api/certificates_v1alpha1_api.py @@ -0,0 +1,1473 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CertificatesV1alpha1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_cluster_trust_bundle(self, body, **kwargs): # noqa: E501 + """create_cluster_trust_bundle # noqa: E501 + + create a ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_cluster_trust_bundle(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1alpha1ClusterTrustBundle + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1ClusterTrustBundle + """ + kwargs['_return_http_data_only'] = True + return self.create_cluster_trust_bundle_with_http_info(body, **kwargs) # noqa: E501 + + def create_cluster_trust_bundle_with_http_info(self, body, **kwargs): # noqa: E501 + """create_cluster_trust_bundle # noqa: E501 + + create a ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_cluster_trust_bundle_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1alpha1ClusterTrustBundle + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1ClusterTrustBundle, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_cluster_trust_bundle`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1ClusterTrustBundle", + 201: "V1alpha1ClusterTrustBundle", + 202: "V1alpha1ClusterTrustBundle", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1alpha1/clustertrustbundles', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_cluster_trust_bundle(self, name, **kwargs): # noqa: E501 + """delete_cluster_trust_bundle # noqa: E501 + + delete a ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_cluster_trust_bundle(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_cluster_trust_bundle_with_http_info(name, **kwargs) # noqa: E501 + + def delete_cluster_trust_bundle_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_cluster_trust_bundle # noqa: E501 + + delete a ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_cluster_trust_bundle_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_cluster_trust_bundle`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_cluster_trust_bundle(self, **kwargs): # noqa: E501 + """delete_collection_cluster_trust_bundle # noqa: E501 + + delete collection of ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_cluster_trust_bundle(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_cluster_trust_bundle_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_cluster_trust_bundle_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_cluster_trust_bundle # noqa: E501 + + delete collection of ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_cluster_trust_bundle_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1alpha1/clustertrustbundles', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1alpha1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_cluster_trust_bundle(self, **kwargs): # noqa: E501 + """list_cluster_trust_bundle # noqa: E501 + + list or watch objects of kind ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_cluster_trust_bundle(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1ClusterTrustBundleList + """ + kwargs['_return_http_data_only'] = True + return self.list_cluster_trust_bundle_with_http_info(**kwargs) # noqa: E501 + + def list_cluster_trust_bundle_with_http_info(self, **kwargs): # noqa: E501 + """list_cluster_trust_bundle # noqa: E501 + + list or watch objects of kind ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_cluster_trust_bundle_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1ClusterTrustBundleList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1ClusterTrustBundleList", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1alpha1/clustertrustbundles', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_cluster_trust_bundle(self, name, body, **kwargs): # noqa: E501 + """patch_cluster_trust_bundle # noqa: E501 + + partially update the specified ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_trust_bundle(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1ClusterTrustBundle + """ + kwargs['_return_http_data_only'] = True + return self.patch_cluster_trust_bundle_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_cluster_trust_bundle_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_cluster_trust_bundle # noqa: E501 + + partially update the specified ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_trust_bundle_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1ClusterTrustBundle, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_cluster_trust_bundle`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_cluster_trust_bundle`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1ClusterTrustBundle", + 201: "V1alpha1ClusterTrustBundle", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_cluster_trust_bundle(self, name, **kwargs): # noqa: E501 + """read_cluster_trust_bundle # noqa: E501 + + read the specified ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_cluster_trust_bundle(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1ClusterTrustBundle + """ + kwargs['_return_http_data_only'] = True + return self.read_cluster_trust_bundle_with_http_info(name, **kwargs) # noqa: E501 + + def read_cluster_trust_bundle_with_http_info(self, name, **kwargs): # noqa: E501 + """read_cluster_trust_bundle # noqa: E501 + + read the specified ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_cluster_trust_bundle_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1ClusterTrustBundle, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_cluster_trust_bundle`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1ClusterTrustBundle", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_cluster_trust_bundle(self, name, body, **kwargs): # noqa: E501 + """replace_cluster_trust_bundle # noqa: E501 + + replace the specified ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_trust_bundle(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param body: (required) + :type body: V1alpha1ClusterTrustBundle + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1ClusterTrustBundle + """ + kwargs['_return_http_data_only'] = True + return self.replace_cluster_trust_bundle_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_cluster_trust_bundle_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_cluster_trust_bundle # noqa: E501 + + replace the specified ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_trust_bundle_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param body: (required) + :type body: V1alpha1ClusterTrustBundle + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1ClusterTrustBundle, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_cluster_trust_bundle`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_cluster_trust_bundle`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1ClusterTrustBundle", + 201: "V1alpha1ClusterTrustBundle", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/certificates_v1beta1_api.py b/kubernetes_asyncio/client/api/certificates_v1beta1_api.py new file mode 100644 index 0000000000..34f0a7fbce --- /dev/null +++ b/kubernetes_asyncio/client/api/certificates_v1beta1_api.py @@ -0,0 +1,3600 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CertificatesV1beta1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_cluster_trust_bundle(self, body, **kwargs): # noqa: E501 + """create_cluster_trust_bundle # noqa: E501 + + create a ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_cluster_trust_bundle(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1ClusterTrustBundle + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ClusterTrustBundle + """ + kwargs['_return_http_data_only'] = True + return self.create_cluster_trust_bundle_with_http_info(body, **kwargs) # noqa: E501 + + def create_cluster_trust_bundle_with_http_info(self, body, **kwargs): # noqa: E501 + """create_cluster_trust_bundle # noqa: E501 + + create a ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_cluster_trust_bundle_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1ClusterTrustBundle + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ClusterTrustBundle, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_cluster_trust_bundle`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ClusterTrustBundle", + 201: "V1beta1ClusterTrustBundle", + 202: "V1beta1ClusterTrustBundle", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/clustertrustbundles', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_pod_certificate_request(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_pod_certificate_request # noqa: E501 + + create a PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_pod_certificate_request(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1PodCertificateRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1PodCertificateRequest + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_pod_certificate_request_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_pod_certificate_request_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_pod_certificate_request # noqa: E501 + + create a PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_pod_certificate_request_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1PodCertificateRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1PodCertificateRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_pod_certificate_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_pod_certificate_request`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_pod_certificate_request`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1PodCertificateRequest", + 201: "V1beta1PodCertificateRequest", + 202: "V1beta1PodCertificateRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_cluster_trust_bundle(self, name, **kwargs): # noqa: E501 + """delete_cluster_trust_bundle # noqa: E501 + + delete a ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_cluster_trust_bundle(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_cluster_trust_bundle_with_http_info(name, **kwargs) # noqa: E501 + + def delete_cluster_trust_bundle_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_cluster_trust_bundle # noqa: E501 + + delete a ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_cluster_trust_bundle_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_cluster_trust_bundle`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_cluster_trust_bundle(self, **kwargs): # noqa: E501 + """delete_collection_cluster_trust_bundle # noqa: E501 + + delete collection of ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_cluster_trust_bundle(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_cluster_trust_bundle_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_cluster_trust_bundle_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_cluster_trust_bundle # noqa: E501 + + delete collection of ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_cluster_trust_bundle_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/clustertrustbundles', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_pod_certificate_request(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_pod_certificate_request # noqa: E501 + + delete collection of PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_pod_certificate_request(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_pod_certificate_request_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_pod_certificate_request_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_pod_certificate_request # noqa: E501 + + delete collection of PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_pod_certificate_request_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_pod_certificate_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_pod_certificate_request`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_pod_certificate_request(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_pod_certificate_request # noqa: E501 + + delete a PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_pod_certificate_request(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_pod_certificate_request_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_pod_certificate_request_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_pod_certificate_request # noqa: E501 + + delete a PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_pod_certificate_request_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_pod_certificate_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_pod_certificate_request`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_pod_certificate_request`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_cluster_trust_bundle(self, **kwargs): # noqa: E501 + """list_cluster_trust_bundle # noqa: E501 + + list or watch objects of kind ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_cluster_trust_bundle(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ClusterTrustBundleList + """ + kwargs['_return_http_data_only'] = True + return self.list_cluster_trust_bundle_with_http_info(**kwargs) # noqa: E501 + + def list_cluster_trust_bundle_with_http_info(self, **kwargs): # noqa: E501 + """list_cluster_trust_bundle # noqa: E501 + + list or watch objects of kind ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_cluster_trust_bundle_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ClusterTrustBundleList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ClusterTrustBundleList", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/clustertrustbundles', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_pod_certificate_request(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_pod_certificate_request # noqa: E501 + + list or watch objects of kind PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_pod_certificate_request(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1PodCertificateRequestList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_pod_certificate_request_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_pod_certificate_request_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_pod_certificate_request # noqa: E501 + + list or watch objects of kind PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_pod_certificate_request_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1PodCertificateRequestList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_pod_certificate_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_pod_certificate_request`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1PodCertificateRequestList", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_pod_certificate_request_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_pod_certificate_request_for_all_namespaces # noqa: E501 + + list or watch objects of kind PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pod_certificate_request_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1PodCertificateRequestList + """ + kwargs['_return_http_data_only'] = True + return self.list_pod_certificate_request_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_pod_certificate_request_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_pod_certificate_request_for_all_namespaces # noqa: E501 + + list or watch objects of kind PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pod_certificate_request_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1PodCertificateRequestList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_pod_certificate_request_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1PodCertificateRequestList", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/podcertificaterequests', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_cluster_trust_bundle(self, name, body, **kwargs): # noqa: E501 + """patch_cluster_trust_bundle # noqa: E501 + + partially update the specified ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_trust_bundle(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ClusterTrustBundle + """ + kwargs['_return_http_data_only'] = True + return self.patch_cluster_trust_bundle_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_cluster_trust_bundle_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_cluster_trust_bundle # noqa: E501 + + partially update the specified ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_trust_bundle_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ClusterTrustBundle, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_cluster_trust_bundle`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_cluster_trust_bundle`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ClusterTrustBundle", + 201: "V1beta1ClusterTrustBundle", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_pod_certificate_request(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_certificate_request # noqa: E501 + + partially update the specified PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_certificate_request(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1PodCertificateRequest + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_pod_certificate_request_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_pod_certificate_request_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_certificate_request # noqa: E501 + + partially update the specified PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_certificate_request_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1PodCertificateRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_pod_certificate_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_pod_certificate_request`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_pod_certificate_request`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_pod_certificate_request`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1PodCertificateRequest", + 201: "V1beta1PodCertificateRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_pod_certificate_request_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_certificate_request_status # noqa: E501 + + partially update status of the specified PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_certificate_request_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1PodCertificateRequest + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_pod_certificate_request_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_pod_certificate_request_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_certificate_request_status # noqa: E501 + + partially update status of the specified PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_certificate_request_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1PodCertificateRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_pod_certificate_request_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_pod_certificate_request_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_pod_certificate_request_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_pod_certificate_request_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1PodCertificateRequest", + 201: "V1beta1PodCertificateRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_cluster_trust_bundle(self, name, **kwargs): # noqa: E501 + """read_cluster_trust_bundle # noqa: E501 + + read the specified ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_cluster_trust_bundle(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ClusterTrustBundle + """ + kwargs['_return_http_data_only'] = True + return self.read_cluster_trust_bundle_with_http_info(name, **kwargs) # noqa: E501 + + def read_cluster_trust_bundle_with_http_info(self, name, **kwargs): # noqa: E501 + """read_cluster_trust_bundle # noqa: E501 + + read the specified ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_cluster_trust_bundle_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ClusterTrustBundle, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_cluster_trust_bundle`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ClusterTrustBundle", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_pod_certificate_request(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_certificate_request # noqa: E501 + + read the specified PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_certificate_request(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1PodCertificateRequest + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_pod_certificate_request_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_pod_certificate_request_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_certificate_request # noqa: E501 + + read the specified PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_certificate_request_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1PodCertificateRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_pod_certificate_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_pod_certificate_request`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_pod_certificate_request`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1PodCertificateRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_pod_certificate_request_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_certificate_request_status # noqa: E501 + + read status of the specified PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_certificate_request_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1PodCertificateRequest + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_pod_certificate_request_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_pod_certificate_request_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_certificate_request_status # noqa: E501 + + read status of the specified PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_certificate_request_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1PodCertificateRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_pod_certificate_request_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_pod_certificate_request_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_pod_certificate_request_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1PodCertificateRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_cluster_trust_bundle(self, name, body, **kwargs): # noqa: E501 + """replace_cluster_trust_bundle # noqa: E501 + + replace the specified ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_trust_bundle(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param body: (required) + :type body: V1beta1ClusterTrustBundle + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ClusterTrustBundle + """ + kwargs['_return_http_data_only'] = True + return self.replace_cluster_trust_bundle_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_cluster_trust_bundle_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_cluster_trust_bundle # noqa: E501 + + replace the specified ClusterTrustBundle # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_trust_bundle_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterTrustBundle (required) + :type name: str + :param body: (required) + :type body: V1beta1ClusterTrustBundle + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ClusterTrustBundle, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_cluster_trust_bundle" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_cluster_trust_bundle`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_cluster_trust_bundle`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ClusterTrustBundle", + 201: "V1beta1ClusterTrustBundle", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/clustertrustbundles/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_pod_certificate_request(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_certificate_request # noqa: E501 + + replace the specified PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_certificate_request(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1PodCertificateRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1PodCertificateRequest + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_pod_certificate_request_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_pod_certificate_request_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_certificate_request # noqa: E501 + + replace the specified PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_certificate_request_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1PodCertificateRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1PodCertificateRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_pod_certificate_request" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_pod_certificate_request`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_pod_certificate_request`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_pod_certificate_request`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1PodCertificateRequest", + 201: "V1beta1PodCertificateRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_pod_certificate_request_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_certificate_request_status # noqa: E501 + + replace status of the specified PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_certificate_request_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1PodCertificateRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1PodCertificateRequest + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_pod_certificate_request_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_pod_certificate_request_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_certificate_request_status # noqa: E501 + + replace status of the specified PodCertificateRequest # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_certificate_request_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodCertificateRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1PodCertificateRequest + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1PodCertificateRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_pod_certificate_request_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_pod_certificate_request_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_pod_certificate_request_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_pod_certificate_request_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1PodCertificateRequest", + 201: "V1beta1PodCertificateRequest", + 401: None, + } + + return self.api_client.call_api( + '/apis/certificates.k8s.io/v1beta1/namespaces/{namespace}/podcertificaterequests/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/coordination_api.py b/kubernetes_asyncio/client/api/coordination_api.py new file mode 100644 index 0000000000..94b9b17f44 --- /dev/null +++ b/kubernetes_asyncio/client/api/coordination_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CoordinationApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/coordination_v1_api.py b/kubernetes_asyncio/client/api/coordination_v1_api.py new file mode 100644 index 0000000000..c550c5c46f --- /dev/null +++ b/kubernetes_asyncio/client/api/coordination_v1_api.py @@ -0,0 +1,1748 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CoordinationV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_namespaced_lease(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_lease # noqa: E501 + + create a Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_lease(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Lease + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Lease + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_lease_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_lease_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_lease # noqa: E501 + + create a Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_lease_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Lease + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Lease, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_lease" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_lease`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_lease`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Lease", + 201: "V1Lease", + 202: "V1Lease", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_lease(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_lease # noqa: E501 + + delete collection of Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_lease(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_lease_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_lease_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_lease # noqa: E501 + + delete collection of Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_lease_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_lease" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_lease`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_lease(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_lease # noqa: E501 + + delete a Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_lease(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Lease (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_lease_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_lease_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_lease # noqa: E501 + + delete a Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_lease_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Lease (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_lease" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_lease`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_lease`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_lease_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_lease_for_all_namespaces # noqa: E501 + + list or watch objects of kind Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_lease_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1LeaseList + """ + kwargs['_return_http_data_only'] = True + return self.list_lease_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_lease_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_lease_for_all_namespaces # noqa: E501 + + list or watch objects of kind Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_lease_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1LeaseList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_lease_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1LeaseList", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1/leases', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_lease(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_lease # noqa: E501 + + list or watch objects of kind Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_lease(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1LeaseList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_lease_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_lease_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_lease # noqa: E501 + + list or watch objects of kind Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_lease_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1LeaseList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_lease" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_lease`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1LeaseList", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_lease(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_lease # noqa: E501 + + partially update the specified Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_lease(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Lease (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Lease + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_lease_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_lease_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_lease # noqa: E501 + + partially update the specified Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_lease_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Lease (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Lease, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_lease" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_lease`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_lease`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_lease`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Lease", + 201: "V1Lease", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_lease(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_lease # noqa: E501 + + read the specified Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_lease(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Lease (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Lease + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_lease_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_lease_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_lease # noqa: E501 + + read the specified Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_lease_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Lease (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Lease, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_lease" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_lease`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_lease`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Lease", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_lease(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_lease # noqa: E501 + + replace the specified Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_lease(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Lease (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Lease + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Lease + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_lease_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_lease_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_lease # noqa: E501 + + replace the specified Lease # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_lease_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Lease (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Lease + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Lease, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_lease" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_lease`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_lease`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_lease`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Lease", + 201: "V1Lease", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/coordination_v1alpha2_api.py b/kubernetes_asyncio/client/api/coordination_v1alpha2_api.py new file mode 100644 index 0000000000..ed98b9f787 --- /dev/null +++ b/kubernetes_asyncio/client/api/coordination_v1alpha2_api.py @@ -0,0 +1,1748 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CoordinationV1alpha2Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_namespaced_lease_candidate(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_lease_candidate # noqa: E501 + + create a LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_lease_candidate(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1alpha2LeaseCandidate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha2LeaseCandidate + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_lease_candidate_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_lease_candidate_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_lease_candidate # noqa: E501 + + create a LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_lease_candidate_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1alpha2LeaseCandidate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha2LeaseCandidate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha2LeaseCandidate", + 201: "V1alpha2LeaseCandidate", + 202: "V1alpha2LeaseCandidate", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_lease_candidate(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_lease_candidate # noqa: E501 + + delete collection of LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_lease_candidate(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_lease_candidate_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_lease_candidate_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_lease_candidate # noqa: E501 + + delete collection of LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_lease_candidate_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_lease_candidate(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_lease_candidate # noqa: E501 + + delete a LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_lease_candidate(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_lease_candidate_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_lease_candidate_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_lease_candidate # noqa: E501 + + delete a LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_lease_candidate_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1alpha2/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_lease_candidate_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_lease_candidate_for_all_namespaces # noqa: E501 + + list or watch objects of kind LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_lease_candidate_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha2LeaseCandidateList + """ + kwargs['_return_http_data_only'] = True + return self.list_lease_candidate_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_lease_candidate_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_lease_candidate_for_all_namespaces # noqa: E501 + + list or watch objects of kind LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_lease_candidate_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha2LeaseCandidateList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_lease_candidate_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha2LeaseCandidateList", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1alpha2/leasecandidates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_lease_candidate(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_lease_candidate # noqa: E501 + + list or watch objects of kind LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_lease_candidate(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha2LeaseCandidateList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_lease_candidate_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_lease_candidate_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_lease_candidate # noqa: E501 + + list or watch objects of kind LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_lease_candidate_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha2LeaseCandidateList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha2LeaseCandidateList", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_lease_candidate(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_lease_candidate # noqa: E501 + + partially update the specified LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_lease_candidate(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha2LeaseCandidate + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_lease_candidate_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_lease_candidate_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_lease_candidate # noqa: E501 + + partially update the specified LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_lease_candidate_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha2LeaseCandidate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha2LeaseCandidate", + 201: "V1alpha2LeaseCandidate", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_lease_candidate(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_lease_candidate # noqa: E501 + + read the specified LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_lease_candidate(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha2LeaseCandidate + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_lease_candidate_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_lease_candidate_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_lease_candidate # noqa: E501 + + read the specified LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_lease_candidate_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha2LeaseCandidate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha2LeaseCandidate", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_lease_candidate(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_lease_candidate # noqa: E501 + + replace the specified LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_lease_candidate(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1alpha2LeaseCandidate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha2LeaseCandidate + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_lease_candidate_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_lease_candidate_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_lease_candidate # noqa: E501 + + replace the specified LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_lease_candidate_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1alpha2LeaseCandidate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha2LeaseCandidate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha2LeaseCandidate", + 201: "V1alpha2LeaseCandidate", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1alpha2/namespaces/{namespace}/leasecandidates/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/coordination_v1beta1_api.py b/kubernetes_asyncio/client/api/coordination_v1beta1_api.py new file mode 100644 index 0000000000..0276bfd3ae --- /dev/null +++ b/kubernetes_asyncio/client/api/coordination_v1beta1_api.py @@ -0,0 +1,1748 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CoordinationV1beta1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_namespaced_lease_candidate(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_lease_candidate # noqa: E501 + + create a LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_lease_candidate(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1LeaseCandidate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1LeaseCandidate + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_lease_candidate_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_lease_candidate_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_lease_candidate # noqa: E501 + + create a LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_lease_candidate_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1LeaseCandidate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1LeaseCandidate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1LeaseCandidate", + 201: "V1beta1LeaseCandidate", + 202: "V1beta1LeaseCandidate", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_lease_candidate(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_lease_candidate # noqa: E501 + + delete collection of LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_lease_candidate(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_lease_candidate_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_lease_candidate_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_lease_candidate # noqa: E501 + + delete collection of LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_lease_candidate_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_lease_candidate(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_lease_candidate # noqa: E501 + + delete a LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_lease_candidate(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_lease_candidate_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_lease_candidate_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_lease_candidate # noqa: E501 + + delete a LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_lease_candidate_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1beta1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_lease_candidate_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_lease_candidate_for_all_namespaces # noqa: E501 + + list or watch objects of kind LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_lease_candidate_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1LeaseCandidateList + """ + kwargs['_return_http_data_only'] = True + return self.list_lease_candidate_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_lease_candidate_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_lease_candidate_for_all_namespaces # noqa: E501 + + list or watch objects of kind LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_lease_candidate_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1LeaseCandidateList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_lease_candidate_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1LeaseCandidateList", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1beta1/leasecandidates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_lease_candidate(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_lease_candidate # noqa: E501 + + list or watch objects of kind LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_lease_candidate(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1LeaseCandidateList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_lease_candidate_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_lease_candidate_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_lease_candidate # noqa: E501 + + list or watch objects of kind LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_lease_candidate_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1LeaseCandidateList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1LeaseCandidateList", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_lease_candidate(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_lease_candidate # noqa: E501 + + partially update the specified LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_lease_candidate(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1LeaseCandidate + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_lease_candidate_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_lease_candidate_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_lease_candidate # noqa: E501 + + partially update the specified LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_lease_candidate_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1LeaseCandidate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1LeaseCandidate", + 201: "V1beta1LeaseCandidate", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_lease_candidate(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_lease_candidate # noqa: E501 + + read the specified LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_lease_candidate(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1LeaseCandidate + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_lease_candidate_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_lease_candidate_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_lease_candidate # noqa: E501 + + read the specified LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_lease_candidate_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1LeaseCandidate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1LeaseCandidate", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_lease_candidate(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_lease_candidate # noqa: E501 + + replace the specified LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_lease_candidate(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1LeaseCandidate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1LeaseCandidate + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_lease_candidate_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_lease_candidate_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_lease_candidate # noqa: E501 + + replace the specified LeaseCandidate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_lease_candidate_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the LeaseCandidate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1LeaseCandidate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1LeaseCandidate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_lease_candidate" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_lease_candidate`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_lease_candidate`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1LeaseCandidate", + 201: "V1beta1LeaseCandidate", + 401: None, + } + + return self.api_client.call_api( + '/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leasecandidates/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/core_api.py b/kubernetes_asyncio/client/api/core_api.py new file mode 100644 index 0000000000..78a27f7114 --- /dev/null +++ b/kubernetes_asyncio/client/api/core_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CoreApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_versions(self, **kwargs): # noqa: E501 + """get_api_versions # noqa: E501 + + get available API versions # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_versions(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIVersions + """ + kwargs['_return_http_data_only'] = True + return self.get_api_versions_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_versions_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIVersions, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_versions" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIVersions", + 401: None, + } + + return self.api_client.call_api( + '/api/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/core_v1_api.py b/kubernetes_asyncio/client/api/core_v1_api.py new file mode 100644 index 0000000000..e3472bf311 --- /dev/null +++ b/kubernetes_asyncio/client/api/core_v1_api.py @@ -0,0 +1,37869 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CoreV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def connect_delete_namespaced_pod_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_delete_namespaced_pod_proxy # noqa: E501 + + connect DELETE requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_delete_namespaced_pod_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_delete_namespaced_pod_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_delete_namespaced_pod_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_delete_namespaced_pod_proxy # noqa: E501 + + connect DELETE requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_delete_namespaced_pod_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_delete_namespaced_pod_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_delete_namespaced_pod_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_delete_namespaced_pod_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_delete_namespaced_pod_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_delete_namespaced_pod_proxy_with_path # noqa: E501 + + connect DELETE requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_delete_namespaced_pod_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_delete_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_delete_namespaced_pod_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_delete_namespaced_pod_proxy_with_path # noqa: E501 + + connect DELETE requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_delete_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_delete_namespaced_pod_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_delete_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_delete_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_delete_namespaced_pod_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_delete_namespaced_service_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_delete_namespaced_service_proxy # noqa: E501 + + connect DELETE requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_delete_namespaced_service_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_delete_namespaced_service_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_delete_namespaced_service_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_delete_namespaced_service_proxy # noqa: E501 + + connect DELETE requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_delete_namespaced_service_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_delete_namespaced_service_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_delete_namespaced_service_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_delete_namespaced_service_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_delete_namespaced_service_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_delete_namespaced_service_proxy_with_path # noqa: E501 + + connect DELETE requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_delete_namespaced_service_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_delete_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_delete_namespaced_service_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_delete_namespaced_service_proxy_with_path # noqa: E501 + + connect DELETE requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_delete_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_delete_namespaced_service_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_delete_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_delete_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_delete_namespaced_service_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_delete_node_proxy(self, name, **kwargs): # noqa: E501 + """connect_delete_node_proxy # noqa: E501 + + connect DELETE requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_delete_node_proxy(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_delete_node_proxy_with_http_info(name, **kwargs) # noqa: E501 + + def connect_delete_node_proxy_with_http_info(self, name, **kwargs): # noqa: E501 + """connect_delete_node_proxy # noqa: E501 + + connect DELETE requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_delete_node_proxy_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_delete_node_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_delete_node_proxy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_delete_node_proxy_with_path(self, name, path, **kwargs): # noqa: E501 + """connect_delete_node_proxy_with_path # noqa: E501 + + connect DELETE requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_delete_node_proxy_with_path(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_delete_node_proxy_with_path_with_http_info(name, path, **kwargs) # noqa: E501 + + def connect_delete_node_proxy_with_path_with_http_info(self, name, path, **kwargs): # noqa: E501 + """connect_delete_node_proxy_with_path # noqa: E501 + + connect DELETE requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_delete_node_proxy_with_path_with_http_info(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_delete_node_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_delete_node_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_delete_node_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy/{path}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_get_namespaced_pod_attach(self, name, namespace, **kwargs): # noqa: E501 + """connect_get_namespaced_pod_attach # noqa: E501 + + connect GET requests to attach of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_pod_attach(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodAttachOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param container: The container in which to execute the command. Defaults to only container if there is only one container in the pod. + :type container: str + :param stderr: Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true. + :type stderr: bool + :param stdin: Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false. + :type stdin: bool + :param stdout: Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true. + :type stdout: bool + :param tty: TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false. + :type tty: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_get_namespaced_pod_attach_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_get_namespaced_pod_attach_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_get_namespaced_pod_attach # noqa: E501 + + connect GET requests to attach of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_pod_attach_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodAttachOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param container: The container in which to execute the command. Defaults to only container if there is only one container in the pod. + :type container: str + :param stderr: Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true. + :type stderr: bool + :param stdin: Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false. + :type stdin: bool + :param stdout: Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true. + :type stdout: bool + :param tty: TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false. + :type tty: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'container', + 'stderr', + 'stdin', + 'stdout', + 'tty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_get_namespaced_pod_attach" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_get_namespaced_pod_attach`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_get_namespaced_pod_attach`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('container') is not None: # noqa: E501 + query_params.append(('container', local_var_params['container'])) # noqa: E501 + if local_var_params.get('stderr') is not None: # noqa: E501 + query_params.append(('stderr', local_var_params['stderr'])) # noqa: E501 + if local_var_params.get('stdin') is not None: # noqa: E501 + query_params.append(('stdin', local_var_params['stdin'])) # noqa: E501 + if local_var_params.get('stdout') is not None: # noqa: E501 + query_params.append(('stdout', local_var_params['stdout'])) # noqa: E501 + if local_var_params.get('tty') is not None: # noqa: E501 + query_params.append(('tty', local_var_params['tty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/attach', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_get_namespaced_pod_exec(self, name, namespace, **kwargs): # noqa: E501 + """connect_get_namespaced_pod_exec # noqa: E501 + + connect GET requests to exec of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_pod_exec(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodExecOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param command: Command is the remote command to execute. argv array. Not executed within a shell. + :type command: str + :param container: Container in which to execute the command. Defaults to only container if there is only one container in the pod. + :type container: str + :param stderr: Redirect the standard error stream of the pod for this call. + :type stderr: bool + :param stdin: Redirect the standard input stream of the pod for this call. Defaults to false. + :type stdin: bool + :param stdout: Redirect the standard output stream of the pod for this call. + :type stdout: bool + :param tty: TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. + :type tty: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_get_namespaced_pod_exec_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_get_namespaced_pod_exec_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_get_namespaced_pod_exec # noqa: E501 + + connect GET requests to exec of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_pod_exec_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodExecOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param command: Command is the remote command to execute. argv array. Not executed within a shell. + :type command: str + :param container: Container in which to execute the command. Defaults to only container if there is only one container in the pod. + :type container: str + :param stderr: Redirect the standard error stream of the pod for this call. + :type stderr: bool + :param stdin: Redirect the standard input stream of the pod for this call. Defaults to false. + :type stdin: bool + :param stdout: Redirect the standard output stream of the pod for this call. + :type stdout: bool + :param tty: TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. + :type tty: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'command', + 'container', + 'stderr', + 'stdin', + 'stdout', + 'tty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_get_namespaced_pod_exec" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_get_namespaced_pod_exec`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_get_namespaced_pod_exec`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('command') is not None: # noqa: E501 + query_params.append(('command', local_var_params['command'])) # noqa: E501 + if local_var_params.get('container') is not None: # noqa: E501 + query_params.append(('container', local_var_params['container'])) # noqa: E501 + if local_var_params.get('stderr') is not None: # noqa: E501 + query_params.append(('stderr', local_var_params['stderr'])) # noqa: E501 + if local_var_params.get('stdin') is not None: # noqa: E501 + query_params.append(('stdin', local_var_params['stdin'])) # noqa: E501 + if local_var_params.get('stdout') is not None: # noqa: E501 + query_params.append(('stdout', local_var_params['stdout'])) # noqa: E501 + if local_var_params.get('tty') is not None: # noqa: E501 + query_params.append(('tty', local_var_params['tty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/exec', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_get_namespaced_pod_portforward(self, name, namespace, **kwargs): # noqa: E501 + """connect_get_namespaced_pod_portforward # noqa: E501 + + connect GET requests to portforward of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_pod_portforward(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodPortForwardOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param ports: List of ports to forward Required when using WebSockets + :type ports: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_get_namespaced_pod_portforward_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_get_namespaced_pod_portforward_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_get_namespaced_pod_portforward # noqa: E501 + + connect GET requests to portforward of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_pod_portforward_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodPortForwardOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param ports: List of ports to forward Required when using WebSockets + :type ports: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'ports' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_get_namespaced_pod_portforward" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_get_namespaced_pod_portforward`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_get_namespaced_pod_portforward`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('ports') is not None: # noqa: E501 + query_params.append(('ports', local_var_params['ports'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/portforward', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_get_namespaced_pod_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_get_namespaced_pod_proxy # noqa: E501 + + connect GET requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_pod_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_get_namespaced_pod_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_get_namespaced_pod_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_get_namespaced_pod_proxy # noqa: E501 + + connect GET requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_pod_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_get_namespaced_pod_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_get_namespaced_pod_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_get_namespaced_pod_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_get_namespaced_pod_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_get_namespaced_pod_proxy_with_path # noqa: E501 + + connect GET requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_pod_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_get_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_get_namespaced_pod_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_get_namespaced_pod_proxy_with_path # noqa: E501 + + connect GET requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_get_namespaced_pod_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_get_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_get_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_get_namespaced_pod_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_get_namespaced_service_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_get_namespaced_service_proxy # noqa: E501 + + connect GET requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_service_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_get_namespaced_service_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_get_namespaced_service_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_get_namespaced_service_proxy # noqa: E501 + + connect GET requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_service_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_get_namespaced_service_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_get_namespaced_service_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_get_namespaced_service_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_get_namespaced_service_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_get_namespaced_service_proxy_with_path # noqa: E501 + + connect GET requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_service_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_get_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_get_namespaced_service_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_get_namespaced_service_proxy_with_path # noqa: E501 + + connect GET requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_get_namespaced_service_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_get_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_get_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_get_namespaced_service_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_get_node_proxy(self, name, **kwargs): # noqa: E501 + """connect_get_node_proxy # noqa: E501 + + connect GET requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_node_proxy(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_get_node_proxy_with_http_info(name, **kwargs) # noqa: E501 + + def connect_get_node_proxy_with_http_info(self, name, **kwargs): # noqa: E501 + """connect_get_node_proxy # noqa: E501 + + connect GET requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_node_proxy_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_get_node_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_get_node_proxy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_get_node_proxy_with_path(self, name, path, **kwargs): # noqa: E501 + """connect_get_node_proxy_with_path # noqa: E501 + + connect GET requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_node_proxy_with_path(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_get_node_proxy_with_path_with_http_info(name, path, **kwargs) # noqa: E501 + + def connect_get_node_proxy_with_path_with_http_info(self, name, path, **kwargs): # noqa: E501 + """connect_get_node_proxy_with_path # noqa: E501 + + connect GET requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_get_node_proxy_with_path_with_http_info(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_get_node_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_get_node_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_get_node_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy/{path}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_head_namespaced_pod_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_head_namespaced_pod_proxy # noqa: E501 + + connect HEAD requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_head_namespaced_pod_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_head_namespaced_pod_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_head_namespaced_pod_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_head_namespaced_pod_proxy # noqa: E501 + + connect HEAD requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_head_namespaced_pod_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_head_namespaced_pod_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_head_namespaced_pod_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_head_namespaced_pod_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy', 'HEAD', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_head_namespaced_pod_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_head_namespaced_pod_proxy_with_path # noqa: E501 + + connect HEAD requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_head_namespaced_pod_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_head_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_head_namespaced_pod_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_head_namespaced_pod_proxy_with_path # noqa: E501 + + connect HEAD requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_head_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_head_namespaced_pod_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_head_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_head_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_head_namespaced_pod_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}', 'HEAD', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_head_namespaced_service_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_head_namespaced_service_proxy # noqa: E501 + + connect HEAD requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_head_namespaced_service_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_head_namespaced_service_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_head_namespaced_service_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_head_namespaced_service_proxy # noqa: E501 + + connect HEAD requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_head_namespaced_service_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_head_namespaced_service_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_head_namespaced_service_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_head_namespaced_service_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy', 'HEAD', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_head_namespaced_service_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_head_namespaced_service_proxy_with_path # noqa: E501 + + connect HEAD requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_head_namespaced_service_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_head_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_head_namespaced_service_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_head_namespaced_service_proxy_with_path # noqa: E501 + + connect HEAD requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_head_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_head_namespaced_service_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_head_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_head_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_head_namespaced_service_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}', 'HEAD', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_head_node_proxy(self, name, **kwargs): # noqa: E501 + """connect_head_node_proxy # noqa: E501 + + connect HEAD requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_head_node_proxy(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_head_node_proxy_with_http_info(name, **kwargs) # noqa: E501 + + def connect_head_node_proxy_with_http_info(self, name, **kwargs): # noqa: E501 + """connect_head_node_proxy # noqa: E501 + + connect HEAD requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_head_node_proxy_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_head_node_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_head_node_proxy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy', 'HEAD', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_head_node_proxy_with_path(self, name, path, **kwargs): # noqa: E501 + """connect_head_node_proxy_with_path # noqa: E501 + + connect HEAD requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_head_node_proxy_with_path(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_head_node_proxy_with_path_with_http_info(name, path, **kwargs) # noqa: E501 + + def connect_head_node_proxy_with_path_with_http_info(self, name, path, **kwargs): # noqa: E501 + """connect_head_node_proxy_with_path # noqa: E501 + + connect HEAD requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_head_node_proxy_with_path_with_http_info(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_head_node_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_head_node_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_head_node_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy/{path}', 'HEAD', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_options_namespaced_pod_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_options_namespaced_pod_proxy # noqa: E501 + + connect OPTIONS requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_options_namespaced_pod_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_options_namespaced_pod_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_options_namespaced_pod_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_options_namespaced_pod_proxy # noqa: E501 + + connect OPTIONS requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_options_namespaced_pod_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_options_namespaced_pod_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_options_namespaced_pod_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_options_namespaced_pod_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy', 'OPTIONS', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_options_namespaced_pod_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_options_namespaced_pod_proxy_with_path # noqa: E501 + + connect OPTIONS requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_options_namespaced_pod_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_options_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_options_namespaced_pod_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_options_namespaced_pod_proxy_with_path # noqa: E501 + + connect OPTIONS requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_options_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_options_namespaced_pod_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_options_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_options_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_options_namespaced_pod_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}', 'OPTIONS', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_options_namespaced_service_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_options_namespaced_service_proxy # noqa: E501 + + connect OPTIONS requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_options_namespaced_service_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_options_namespaced_service_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_options_namespaced_service_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_options_namespaced_service_proxy # noqa: E501 + + connect OPTIONS requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_options_namespaced_service_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_options_namespaced_service_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_options_namespaced_service_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_options_namespaced_service_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy', 'OPTIONS', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_options_namespaced_service_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_options_namespaced_service_proxy_with_path # noqa: E501 + + connect OPTIONS requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_options_namespaced_service_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_options_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_options_namespaced_service_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_options_namespaced_service_proxy_with_path # noqa: E501 + + connect OPTIONS requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_options_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_options_namespaced_service_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_options_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_options_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_options_namespaced_service_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}', 'OPTIONS', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_options_node_proxy(self, name, **kwargs): # noqa: E501 + """connect_options_node_proxy # noqa: E501 + + connect OPTIONS requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_options_node_proxy(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_options_node_proxy_with_http_info(name, **kwargs) # noqa: E501 + + def connect_options_node_proxy_with_http_info(self, name, **kwargs): # noqa: E501 + """connect_options_node_proxy # noqa: E501 + + connect OPTIONS requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_options_node_proxy_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_options_node_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_options_node_proxy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy', 'OPTIONS', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_options_node_proxy_with_path(self, name, path, **kwargs): # noqa: E501 + """connect_options_node_proxy_with_path # noqa: E501 + + connect OPTIONS requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_options_node_proxy_with_path(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_options_node_proxy_with_path_with_http_info(name, path, **kwargs) # noqa: E501 + + def connect_options_node_proxy_with_path_with_http_info(self, name, path, **kwargs): # noqa: E501 + """connect_options_node_proxy_with_path # noqa: E501 + + connect OPTIONS requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_options_node_proxy_with_path_with_http_info(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_options_node_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_options_node_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_options_node_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy/{path}', 'OPTIONS', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_patch_namespaced_pod_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_patch_namespaced_pod_proxy # noqa: E501 + + connect PATCH requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_patch_namespaced_pod_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_patch_namespaced_pod_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_patch_namespaced_pod_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_patch_namespaced_pod_proxy # noqa: E501 + + connect PATCH requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_patch_namespaced_pod_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_patch_namespaced_pod_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_patch_namespaced_pod_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_patch_namespaced_pod_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_patch_namespaced_pod_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_patch_namespaced_pod_proxy_with_path # noqa: E501 + + connect PATCH requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_patch_namespaced_pod_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_patch_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_patch_namespaced_pod_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_patch_namespaced_pod_proxy_with_path # noqa: E501 + + connect PATCH requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_patch_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_patch_namespaced_pod_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_patch_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_patch_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_patch_namespaced_pod_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_patch_namespaced_service_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_patch_namespaced_service_proxy # noqa: E501 + + connect PATCH requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_patch_namespaced_service_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_patch_namespaced_service_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_patch_namespaced_service_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_patch_namespaced_service_proxy # noqa: E501 + + connect PATCH requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_patch_namespaced_service_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_patch_namespaced_service_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_patch_namespaced_service_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_patch_namespaced_service_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_patch_namespaced_service_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_patch_namespaced_service_proxy_with_path # noqa: E501 + + connect PATCH requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_patch_namespaced_service_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_patch_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_patch_namespaced_service_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_patch_namespaced_service_proxy_with_path # noqa: E501 + + connect PATCH requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_patch_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_patch_namespaced_service_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_patch_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_patch_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_patch_namespaced_service_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_patch_node_proxy(self, name, **kwargs): # noqa: E501 + """connect_patch_node_proxy # noqa: E501 + + connect PATCH requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_patch_node_proxy(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_patch_node_proxy_with_http_info(name, **kwargs) # noqa: E501 + + def connect_patch_node_proxy_with_http_info(self, name, **kwargs): # noqa: E501 + """connect_patch_node_proxy # noqa: E501 + + connect PATCH requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_patch_node_proxy_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_patch_node_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_patch_node_proxy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_patch_node_proxy_with_path(self, name, path, **kwargs): # noqa: E501 + """connect_patch_node_proxy_with_path # noqa: E501 + + connect PATCH requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_patch_node_proxy_with_path(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_patch_node_proxy_with_path_with_http_info(name, path, **kwargs) # noqa: E501 + + def connect_patch_node_proxy_with_path_with_http_info(self, name, path, **kwargs): # noqa: E501 + """connect_patch_node_proxy_with_path # noqa: E501 + + connect PATCH requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_patch_node_proxy_with_path_with_http_info(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_patch_node_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_patch_node_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_patch_node_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy/{path}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_post_namespaced_pod_attach(self, name, namespace, **kwargs): # noqa: E501 + """connect_post_namespaced_pod_attach # noqa: E501 + + connect POST requests to attach of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_pod_attach(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodAttachOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param container: The container in which to execute the command. Defaults to only container if there is only one container in the pod. + :type container: str + :param stderr: Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true. + :type stderr: bool + :param stdin: Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false. + :type stdin: bool + :param stdout: Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true. + :type stdout: bool + :param tty: TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false. + :type tty: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_post_namespaced_pod_attach_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_post_namespaced_pod_attach_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_post_namespaced_pod_attach # noqa: E501 + + connect POST requests to attach of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_pod_attach_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodAttachOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param container: The container in which to execute the command. Defaults to only container if there is only one container in the pod. + :type container: str + :param stderr: Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true. + :type stderr: bool + :param stdin: Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false. + :type stdin: bool + :param stdout: Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true. + :type stdout: bool + :param tty: TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false. + :type tty: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'container', + 'stderr', + 'stdin', + 'stdout', + 'tty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_post_namespaced_pod_attach" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_post_namespaced_pod_attach`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_post_namespaced_pod_attach`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('container') is not None: # noqa: E501 + query_params.append(('container', local_var_params['container'])) # noqa: E501 + if local_var_params.get('stderr') is not None: # noqa: E501 + query_params.append(('stderr', local_var_params['stderr'])) # noqa: E501 + if local_var_params.get('stdin') is not None: # noqa: E501 + query_params.append(('stdin', local_var_params['stdin'])) # noqa: E501 + if local_var_params.get('stdout') is not None: # noqa: E501 + query_params.append(('stdout', local_var_params['stdout'])) # noqa: E501 + if local_var_params.get('tty') is not None: # noqa: E501 + query_params.append(('tty', local_var_params['tty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/attach', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_post_namespaced_pod_exec(self, name, namespace, **kwargs): # noqa: E501 + """connect_post_namespaced_pod_exec # noqa: E501 + + connect POST requests to exec of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_pod_exec(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodExecOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param command: Command is the remote command to execute. argv array. Not executed within a shell. + :type command: str + :param container: Container in which to execute the command. Defaults to only container if there is only one container in the pod. + :type container: str + :param stderr: Redirect the standard error stream of the pod for this call. + :type stderr: bool + :param stdin: Redirect the standard input stream of the pod for this call. Defaults to false. + :type stdin: bool + :param stdout: Redirect the standard output stream of the pod for this call. + :type stdout: bool + :param tty: TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. + :type tty: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_post_namespaced_pod_exec_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_post_namespaced_pod_exec_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_post_namespaced_pod_exec # noqa: E501 + + connect POST requests to exec of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_pod_exec_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodExecOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param command: Command is the remote command to execute. argv array. Not executed within a shell. + :type command: str + :param container: Container in which to execute the command. Defaults to only container if there is only one container in the pod. + :type container: str + :param stderr: Redirect the standard error stream of the pod for this call. + :type stderr: bool + :param stdin: Redirect the standard input stream of the pod for this call. Defaults to false. + :type stdin: bool + :param stdout: Redirect the standard output stream of the pod for this call. + :type stdout: bool + :param tty: TTY if true indicates that a tty will be allocated for the exec call. Defaults to false. + :type tty: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'command', + 'container', + 'stderr', + 'stdin', + 'stdout', + 'tty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_post_namespaced_pod_exec" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_post_namespaced_pod_exec`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_post_namespaced_pod_exec`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('command') is not None: # noqa: E501 + query_params.append(('command', local_var_params['command'])) # noqa: E501 + if local_var_params.get('container') is not None: # noqa: E501 + query_params.append(('container', local_var_params['container'])) # noqa: E501 + if local_var_params.get('stderr') is not None: # noqa: E501 + query_params.append(('stderr', local_var_params['stderr'])) # noqa: E501 + if local_var_params.get('stdin') is not None: # noqa: E501 + query_params.append(('stdin', local_var_params['stdin'])) # noqa: E501 + if local_var_params.get('stdout') is not None: # noqa: E501 + query_params.append(('stdout', local_var_params['stdout'])) # noqa: E501 + if local_var_params.get('tty') is not None: # noqa: E501 + query_params.append(('tty', local_var_params['tty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/exec', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_post_namespaced_pod_portforward(self, name, namespace, **kwargs): # noqa: E501 + """connect_post_namespaced_pod_portforward # noqa: E501 + + connect POST requests to portforward of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_pod_portforward(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodPortForwardOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param ports: List of ports to forward Required when using WebSockets + :type ports: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_post_namespaced_pod_portforward_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_post_namespaced_pod_portforward_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_post_namespaced_pod_portforward # noqa: E501 + + connect POST requests to portforward of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_pod_portforward_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodPortForwardOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param ports: List of ports to forward Required when using WebSockets + :type ports: int + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'ports' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_post_namespaced_pod_portforward" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_post_namespaced_pod_portforward`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_post_namespaced_pod_portforward`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('ports') is not None: # noqa: E501 + query_params.append(('ports', local_var_params['ports'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/portforward', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_post_namespaced_pod_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_post_namespaced_pod_proxy # noqa: E501 + + connect POST requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_pod_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_post_namespaced_pod_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_post_namespaced_pod_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_post_namespaced_pod_proxy # noqa: E501 + + connect POST requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_pod_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_post_namespaced_pod_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_post_namespaced_pod_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_post_namespaced_pod_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_post_namespaced_pod_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_post_namespaced_pod_proxy_with_path # noqa: E501 + + connect POST requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_pod_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_post_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_post_namespaced_pod_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_post_namespaced_pod_proxy_with_path # noqa: E501 + + connect POST requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_post_namespaced_pod_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_post_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_post_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_post_namespaced_pod_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_post_namespaced_service_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_post_namespaced_service_proxy # noqa: E501 + + connect POST requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_service_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_post_namespaced_service_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_post_namespaced_service_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_post_namespaced_service_proxy # noqa: E501 + + connect POST requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_service_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_post_namespaced_service_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_post_namespaced_service_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_post_namespaced_service_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_post_namespaced_service_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_post_namespaced_service_proxy_with_path # noqa: E501 + + connect POST requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_service_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_post_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_post_namespaced_service_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_post_namespaced_service_proxy_with_path # noqa: E501 + + connect POST requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_post_namespaced_service_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_post_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_post_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_post_namespaced_service_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_post_node_proxy(self, name, **kwargs): # noqa: E501 + """connect_post_node_proxy # noqa: E501 + + connect POST requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_node_proxy(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_post_node_proxy_with_http_info(name, **kwargs) # noqa: E501 + + def connect_post_node_proxy_with_http_info(self, name, **kwargs): # noqa: E501 + """connect_post_node_proxy # noqa: E501 + + connect POST requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_node_proxy_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_post_node_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_post_node_proxy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_post_node_proxy_with_path(self, name, path, **kwargs): # noqa: E501 + """connect_post_node_proxy_with_path # noqa: E501 + + connect POST requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_node_proxy_with_path(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_post_node_proxy_with_path_with_http_info(name, path, **kwargs) # noqa: E501 + + def connect_post_node_proxy_with_path_with_http_info(self, name, path, **kwargs): # noqa: E501 + """connect_post_node_proxy_with_path # noqa: E501 + + connect POST requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_post_node_proxy_with_path_with_http_info(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_post_node_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_post_node_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_post_node_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy/{path}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_put_namespaced_pod_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_put_namespaced_pod_proxy # noqa: E501 + + connect PUT requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_put_namespaced_pod_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_put_namespaced_pod_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_put_namespaced_pod_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_put_namespaced_pod_proxy # noqa: E501 + + connect PUT requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_put_namespaced_pod_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the URL path to use for the current proxy request to pod. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_put_namespaced_pod_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_put_namespaced_pod_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_put_namespaced_pod_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_put_namespaced_pod_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_put_namespaced_pod_proxy_with_path # noqa: E501 + + connect PUT requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_put_namespaced_pod_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_put_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_put_namespaced_pod_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_put_namespaced_pod_proxy_with_path # noqa: E501 + + connect PUT requests to proxy of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_put_namespaced_pod_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the PodProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to pod. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_put_namespaced_pod_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_put_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_put_namespaced_pod_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_put_namespaced_pod_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_put_namespaced_service_proxy(self, name, namespace, **kwargs): # noqa: E501 + """connect_put_namespaced_service_proxy # noqa: E501 + + connect PUT requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_put_namespaced_service_proxy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_put_namespaced_service_proxy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def connect_put_namespaced_service_proxy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """connect_put_namespaced_service_proxy # noqa: E501 + + connect PUT requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_put_namespaced_service_proxy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_put_namespaced_service_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_put_namespaced_service_proxy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_put_namespaced_service_proxy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_put_namespaced_service_proxy_with_path(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_put_namespaced_service_proxy_with_path # noqa: E501 + + connect PUT requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_put_namespaced_service_proxy_with_path(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_put_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, **kwargs) # noqa: E501 + + def connect_put_namespaced_service_proxy_with_path_with_http_info(self, name, namespace, path, **kwargs): # noqa: E501 + """connect_put_namespaced_service_proxy_with_path # noqa: E501 + + connect PUT requests to proxy of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_put_namespaced_service_proxy_with_path_with_http_info(name, namespace, path, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceProxyOptions (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_put_namespaced_service_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_put_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `connect_put_namespaced_service_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_put_namespaced_service_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + 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 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_put_node_proxy(self, name, **kwargs): # noqa: E501 + """connect_put_node_proxy # noqa: E501 + + connect PUT requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_put_node_proxy(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_put_node_proxy_with_http_info(name, **kwargs) # noqa: E501 + + def connect_put_node_proxy_with_http_info(self, name, **kwargs): # noqa: E501 + """connect_put_node_proxy # noqa: E501 + + connect PUT requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_put_node_proxy_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: Path is the URL path to use for the current proxy request to node. + :type path: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_put_node_proxy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_put_node_proxy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('path') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def connect_put_node_proxy_with_path(self, name, path, **kwargs): # noqa: E501 + """connect_put_node_proxy_with_path # noqa: E501 + + connect PUT requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_put_node_proxy_with_path(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.connect_put_node_proxy_with_path_with_http_info(name, path, **kwargs) # noqa: E501 + + def connect_put_node_proxy_with_path_with_http_info(self, name, path, **kwargs): # noqa: E501 + """connect_put_node_proxy_with_path # noqa: E501 + + connect PUT requests to proxy of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.connect_put_node_proxy_with_path_with_http_info(name, path, async_req=True) + >>> result = thread.get() + + :param name: name of the NodeProxyOptions (required) + :type name: str + :param path: path to the resource (required) + :type path: str + :param path2: Path is the URL path to use for the current proxy request to node. + :type path2: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'path', + 'path2' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method connect_put_node_proxy_with_path" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `connect_put_node_proxy_with_path`") # noqa: E501 + # verify the required parameter 'path' is set + if self.api_client.client_side_validation and local_var_params.get('path') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `path` when calling `connect_put_node_proxy_with_path`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + if 'path' in local_var_params: + path_params['path'] = local_var_params['path'] # noqa: E501 + + query_params = [] + if local_var_params.get('path2') is not None: # noqa: E501 + query_params.append(('path', local_var_params['path2'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/proxy/{path}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespace(self, body, **kwargs): # noqa: E501 + """create_namespace # noqa: E501 + + create a Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespace(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1Namespace + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Namespace + """ + kwargs['_return_http_data_only'] = True + return self.create_namespace_with_http_info(body, **kwargs) # noqa: E501 + + def create_namespace_with_http_info(self, body, **kwargs): # noqa: E501 + """create_namespace # noqa: E501 + + create a Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespace_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1Namespace + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Namespace, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespace" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Namespace", + 201: "V1Namespace", + 202: "V1Namespace", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_binding(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_binding # noqa: E501 + + create a Binding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_binding(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Binding + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Binding + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_binding_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_binding_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_binding # noqa: E501 + + create a Binding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_binding_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Binding + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Binding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_binding`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Binding", + 201: "V1Binding", + 202: "V1Binding", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/bindings', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_config_map(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_config_map # noqa: E501 + + create a ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_config_map(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ConfigMap + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ConfigMap + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_config_map_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_config_map_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_config_map # noqa: E501 + + create a ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_config_map_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ConfigMap + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ConfigMap, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_config_map" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_config_map`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_config_map`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ConfigMap", + 201: "V1ConfigMap", + 202: "V1ConfigMap", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/configmaps', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_endpoints(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_endpoints # noqa: E501 + + create Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_endpoints(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Endpoints + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Endpoints + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_endpoints_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_endpoints_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_endpoints # noqa: E501 + + create Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_endpoints_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Endpoints + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Endpoints, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_endpoints" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_endpoints`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_endpoints`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Endpoints", + 201: "V1Endpoints", + 202: "V1Endpoints", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/endpoints', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_event(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_event # noqa: E501 + + create an Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_event(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: CoreV1Event + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CoreV1Event + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_event_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_event_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_event # noqa: E501 + + create an Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_event_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: CoreV1Event + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CoreV1Event, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_event`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_event`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "CoreV1Event", + 201: "CoreV1Event", + 202: "CoreV1Event", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/events', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_limit_range(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_limit_range # noqa: E501 + + create a LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_limit_range(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1LimitRange + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1LimitRange + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_limit_range_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_limit_range_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_limit_range # noqa: E501 + + create a LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_limit_range_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1LimitRange + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1LimitRange, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_limit_range" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_limit_range`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_limit_range`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1LimitRange", + 201: "V1LimitRange", + 202: "V1LimitRange", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/limitranges', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_persistent_volume_claim(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_persistent_volume_claim # noqa: E501 + + create a PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_persistent_volume_claim(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PersistentVolumeClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolumeClaim + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_persistent_volume_claim_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_persistent_volume_claim_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_persistent_volume_claim # noqa: E501 + + create a PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_persistent_volume_claim_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PersistentVolumeClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolumeClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_persistent_volume_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_persistent_volume_claim`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_persistent_volume_claim`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolumeClaim", + 201: "V1PersistentVolumeClaim", + 202: "V1PersistentVolumeClaim", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/persistentvolumeclaims', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_pod(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_pod # noqa: E501 + + create a Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_pod(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Pod + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_pod_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_pod_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_pod # noqa: E501 + + create a Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_pod_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Pod + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_pod" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_pod`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_pod`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 201: "V1Pod", + 202: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_pod_binding(self, name, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_pod_binding # noqa: E501 + + create binding of a Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_pod_binding(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Binding (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Binding + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Binding + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_pod_binding_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_pod_binding_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_pod_binding # noqa: E501 + + create binding of a Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_pod_binding_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Binding (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Binding + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Binding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_pod_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `create_namespaced_pod_binding`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_pod_binding`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_pod_binding`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Binding", + 201: "V1Binding", + 202: "V1Binding", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/binding', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_pod_eviction(self, name, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_pod_eviction # noqa: E501 + + create eviction of a Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_pod_eviction(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Eviction (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Eviction + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Eviction + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_pod_eviction_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_pod_eviction_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_pod_eviction # noqa: E501 + + create eviction of a Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_pod_eviction_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Eviction (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Eviction + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Eviction, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_pod_eviction" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `create_namespaced_pod_eviction`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_pod_eviction`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_pod_eviction`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Eviction", + 201: "V1Eviction", + 202: "V1Eviction", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/eviction', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_pod_template(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_pod_template # noqa: E501 + + create a PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_pod_template(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PodTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodTemplate + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_pod_template_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_pod_template_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_pod_template # noqa: E501 + + create a PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_pod_template_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PodTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_pod_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_pod_template`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_pod_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodTemplate", + 201: "V1PodTemplate", + 202: "V1PodTemplate", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/podtemplates', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_replication_controller(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_replication_controller # noqa: E501 + + create a ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_replication_controller(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ReplicationController + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicationController + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_replication_controller_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_replication_controller_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_replication_controller # noqa: E501 + + create a ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_replication_controller_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ReplicationController + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicationController, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_replication_controller" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_replication_controller`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_replication_controller`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicationController", + 201: "V1ReplicationController", + 202: "V1ReplicationController", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/replicationcontrollers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_resource_quota(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_quota # noqa: E501 + + create a ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_quota(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ResourceQuota + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceQuota + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_resource_quota_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_resource_quota_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_quota # noqa: E501 + + create a ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_quota_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ResourceQuota + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceQuota, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_resource_quota" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_resource_quota`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_resource_quota`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceQuota", + 201: "V1ResourceQuota", + 202: "V1ResourceQuota", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/resourcequotas', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_secret(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_secret # noqa: E501 + + create a Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_secret(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Secret + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Secret + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_secret_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_secret_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_secret # noqa: E501 + + create a Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_secret_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Secret + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Secret, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_secret" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_secret`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_secret`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Secret", + 201: "V1Secret", + 202: "V1Secret", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/secrets', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_service(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_service # noqa: E501 + + create a Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_service(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Service + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Service + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_service_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_service_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_service # noqa: E501 + + create a Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_service_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Service + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Service, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_service`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_service`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Service", + 201: "V1Service", + 202: "V1Service", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_service_account(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_service_account # noqa: E501 + + create a ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_service_account(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ServiceAccount + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceAccount + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_service_account_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_service_account_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_service_account # noqa: E501 + + create a ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_service_account_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ServiceAccount + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceAccount, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_service_account" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_service_account`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_service_account`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceAccount", + 201: "V1ServiceAccount", + 202: "V1ServiceAccount", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/serviceaccounts', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_service_account_token(self, name, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_service_account_token # noqa: E501 + + create token of a ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_service_account_token(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the TokenRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: AuthenticationV1TokenRequest + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: AuthenticationV1TokenRequest + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_service_account_token_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_service_account_token_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_service_account_token # noqa: E501 + + create token of a ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_service_account_token_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the TokenRequest (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: AuthenticationV1TokenRequest + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(AuthenticationV1TokenRequest, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_service_account_token" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `create_namespaced_service_account_token`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_service_account_token`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_service_account_token`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "AuthenticationV1TokenRequest", + 201: "AuthenticationV1TokenRequest", + 202: "AuthenticationV1TokenRequest", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}/token', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_node(self, body, **kwargs): # noqa: E501 + """create_node # noqa: E501 + + create a Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_node(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1Node + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Node + """ + kwargs['_return_http_data_only'] = True + return self.create_node_with_http_info(body, **kwargs) # noqa: E501 + + def create_node_with_http_info(self, body, **kwargs): # noqa: E501 + """create_node # noqa: E501 + + create a Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_node_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1Node + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Node, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_node`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Node", + 201: "V1Node", + 202: "V1Node", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_persistent_volume(self, body, **kwargs): # noqa: E501 + """create_persistent_volume # noqa: E501 + + create a PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_persistent_volume(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1PersistentVolume + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolume + """ + kwargs['_return_http_data_only'] = True + return self.create_persistent_volume_with_http_info(body, **kwargs) # noqa: E501 + + def create_persistent_volume_with_http_info(self, body, **kwargs): # noqa: E501 + """create_persistent_volume # noqa: E501 + + create a PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_persistent_volume_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1PersistentVolume + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolume, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_persistent_volume" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_persistent_volume`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolume", + 201: "V1PersistentVolume", + 202: "V1PersistentVolume", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/persistentvolumes', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_config_map(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_config_map # noqa: E501 + + delete collection of ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_config_map(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_config_map_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_config_map_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_config_map # noqa: E501 + + delete collection of ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_config_map_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_config_map" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_config_map`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/configmaps', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_endpoints(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_endpoints # noqa: E501 + + delete collection of Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_endpoints(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_endpoints_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_endpoints_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_endpoints # noqa: E501 + + delete collection of Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_endpoints_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_endpoints" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_endpoints`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/endpoints', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_event(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_event # noqa: E501 + + delete collection of Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_event(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_event_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_event_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_event # noqa: E501 + + delete collection of Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_event_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_event`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/events', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_limit_range(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_limit_range # noqa: E501 + + delete collection of LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_limit_range(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_limit_range_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_limit_range_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_limit_range # noqa: E501 + + delete collection of LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_limit_range_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_limit_range" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_limit_range`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/limitranges', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_persistent_volume_claim(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_persistent_volume_claim # noqa: E501 + + delete collection of PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_persistent_volume_claim(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_persistent_volume_claim_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_persistent_volume_claim_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_persistent_volume_claim # noqa: E501 + + delete collection of PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_persistent_volume_claim_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_persistent_volume_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_persistent_volume_claim`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/persistentvolumeclaims', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_pod(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_pod # noqa: E501 + + delete collection of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_pod(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_pod_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_pod_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_pod # noqa: E501 + + delete collection of Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_pod_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_pod" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_pod`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_pod_template(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_pod_template # noqa: E501 + + delete collection of PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_pod_template(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_pod_template_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_pod_template_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_pod_template # noqa: E501 + + delete collection of PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_pod_template_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_pod_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_pod_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/podtemplates', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_replication_controller(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_replication_controller # noqa: E501 + + delete collection of ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_replication_controller(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_replication_controller_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_replication_controller_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_replication_controller # noqa: E501 + + delete collection of ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_replication_controller_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_replication_controller" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_replication_controller`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/replicationcontrollers', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_resource_quota(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_quota # noqa: E501 + + delete collection of ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_quota(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_resource_quota_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_resource_quota_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_quota # noqa: E501 + + delete collection of ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_quota_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_resource_quota" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_resource_quota`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/resourcequotas', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_secret(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_secret # noqa: E501 + + delete collection of Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_secret(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_secret_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_secret_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_secret # noqa: E501 + + delete collection of Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_secret_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_secret" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_secret`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/secrets', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_service(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_service # noqa: E501 + + delete collection of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_service(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_service_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_service_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_service # noqa: E501 + + delete collection of Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_service_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_service`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_service_account(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_service_account # noqa: E501 + + delete collection of ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_service_account(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_service_account_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_service_account_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_service_account # noqa: E501 + + delete collection of ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_service_account_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_service_account" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_service_account`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/serviceaccounts', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_node(self, **kwargs): # noqa: E501 + """delete_collection_node # noqa: E501 + + delete collection of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_node(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_node_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_node_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_node # noqa: E501 + + delete collection of Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_node_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_persistent_volume(self, **kwargs): # noqa: E501 + """delete_collection_persistent_volume # noqa: E501 + + delete collection of PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_persistent_volume(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_persistent_volume_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_persistent_volume_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_persistent_volume # noqa: E501 + + delete collection of PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_persistent_volume_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_persistent_volume" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/persistentvolumes', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespace(self, name, **kwargs): # noqa: E501 + """delete_namespace # noqa: E501 + + delete a Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespace(name, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespace_with_http_info(name, **kwargs) # noqa: E501 + + def delete_namespace_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_namespace # noqa: E501 + + delete a Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespace_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespace" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_config_map(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_config_map # noqa: E501 + + delete a ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_config_map(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ConfigMap (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_config_map_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_config_map_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_config_map # noqa: E501 + + delete a ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_config_map_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ConfigMap (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_config_map" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_config_map`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_config_map`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/configmaps/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_endpoints(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_endpoints # noqa: E501 + + delete Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_endpoints(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Endpoints (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_endpoints_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_endpoints_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_endpoints # noqa: E501 + + delete Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_endpoints_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Endpoints (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_endpoints" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_endpoints`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_endpoints`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/endpoints/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_event(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_event # noqa: E501 + + delete an Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_event(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_event_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_event_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_event # noqa: E501 + + delete an Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_event_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_event`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_event`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/events/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_limit_range(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_limit_range # noqa: E501 + + delete a LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_limit_range(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the LimitRange (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_limit_range_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_limit_range_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_limit_range # noqa: E501 + + delete a LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_limit_range_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the LimitRange (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_limit_range" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_limit_range`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_limit_range`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/limitranges/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_persistent_volume_claim(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_persistent_volume_claim # noqa: E501 + + delete a PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_persistent_volume_claim(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolumeClaim + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_persistent_volume_claim_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_persistent_volume_claim_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_persistent_volume_claim # noqa: E501 + + delete a PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_persistent_volume_claim_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolumeClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_persistent_volume_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_persistent_volume_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_persistent_volume_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolumeClaim", + 202: "V1PersistentVolumeClaim", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_pod(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_pod # noqa: E501 + + delete a Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_pod(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_pod_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_pod_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_pod # noqa: E501 + + delete a Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_pod_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_pod" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_pod`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_pod`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 202: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_pod_template(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_pod_template # noqa: E501 + + delete a PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_pod_template(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodTemplate + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_pod_template_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_pod_template_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_pod_template # noqa: E501 + + delete a PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_pod_template_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_pod_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_pod_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_pod_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodTemplate", + 202: "V1PodTemplate", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/podtemplates/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_replication_controller(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_replication_controller # noqa: E501 + + delete a ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_replication_controller(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_replication_controller_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_replication_controller_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_replication_controller # noqa: E501 + + delete a ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_replication_controller_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_replication_controller" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_replication_controller`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_replication_controller`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_resource_quota(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_quota # noqa: E501 + + delete a ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_quota(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceQuota + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_resource_quota_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_resource_quota_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_quota # noqa: E501 + + delete a ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_quota_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceQuota, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_resource_quota" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_resource_quota`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_resource_quota`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceQuota", + 202: "V1ResourceQuota", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/resourcequotas/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_secret(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_secret # noqa: E501 + + delete a Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_secret(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Secret (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_secret_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_secret_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_secret # noqa: E501 + + delete a Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_secret_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Secret (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_secret" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_secret`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_secret`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/secrets/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_service(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_service # noqa: E501 + + delete a Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_service(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Service + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_service_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_service_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_service # noqa: E501 + + delete a Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_service_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Service, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_service`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_service`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Service", + 202: "V1Service", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_service_account(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_service_account # noqa: E501 + + delete a ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_service_account(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceAccount (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceAccount + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_service_account_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_service_account_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_service_account # noqa: E501 + + delete a ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_service_account_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceAccount (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceAccount, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_service_account" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_service_account`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_service_account`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceAccount", + 202: "V1ServiceAccount", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_node(self, name, **kwargs): # noqa: E501 + """delete_node # noqa: E501 + + delete a Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_node(name, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_node_with_http_info(name, **kwargs) # noqa: E501 + + def delete_node_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_node # noqa: E501 + + delete a Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_node_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_node`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_persistent_volume(self, name, **kwargs): # noqa: E501 + """delete_persistent_volume # noqa: E501 + + delete a PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_persistent_volume(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolume + """ + kwargs['_return_http_data_only'] = True + return self.delete_persistent_volume_with_http_info(name, **kwargs) # noqa: E501 + + def delete_persistent_volume_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_persistent_volume # noqa: E501 + + delete a PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_persistent_volume_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolume, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_persistent_volume" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_persistent_volume`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolume", + 202: "V1PersistentVolume", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/persistentvolumes/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_component_status(self, **kwargs): # noqa: E501 + """list_component_status # noqa: E501 + + list objects of kind ComponentStatus # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_component_status(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ComponentStatusList + """ + kwargs['_return_http_data_only'] = True + return self.list_component_status_with_http_info(**kwargs) # noqa: E501 + + def list_component_status_with_http_info(self, **kwargs): # noqa: E501 + """list_component_status # noqa: E501 + + list objects of kind ComponentStatus # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_component_status_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ComponentStatusList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_component_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ComponentStatusList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/componentstatuses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_config_map_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_config_map_for_all_namespaces # noqa: E501 + + list or watch objects of kind ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_config_map_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ConfigMapList + """ + kwargs['_return_http_data_only'] = True + return self.list_config_map_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_config_map_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_config_map_for_all_namespaces # noqa: E501 + + list or watch objects of kind ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_config_map_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ConfigMapList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_config_map_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ConfigMapList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/configmaps', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_endpoints_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_endpoints_for_all_namespaces # noqa: E501 + + list or watch objects of kind Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_endpoints_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1EndpointsList + """ + kwargs['_return_http_data_only'] = True + return self.list_endpoints_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_endpoints_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_endpoints_for_all_namespaces # noqa: E501 + + list or watch objects of kind Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_endpoints_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1EndpointsList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_endpoints_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1EndpointsList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/endpoints', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_event_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_event_for_all_namespaces # noqa: E501 + + list or watch objects of kind Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_event_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CoreV1EventList + """ + kwargs['_return_http_data_only'] = True + return self.list_event_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_event_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_event_for_all_namespaces # noqa: E501 + + list or watch objects of kind Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_event_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CoreV1EventList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_event_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "CoreV1EventList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/events', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_limit_range_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_limit_range_for_all_namespaces # noqa: E501 + + list or watch objects of kind LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_limit_range_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1LimitRangeList + """ + kwargs['_return_http_data_only'] = True + return self.list_limit_range_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_limit_range_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_limit_range_for_all_namespaces # noqa: E501 + + list or watch objects of kind LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_limit_range_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1LimitRangeList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_limit_range_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1LimitRangeList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/limitranges', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespace(self, **kwargs): # noqa: E501 + """list_namespace # noqa: E501 + + list or watch objects of kind Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespace(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1NamespaceList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespace_with_http_info(**kwargs) # noqa: E501 + + def list_namespace_with_http_info(self, **kwargs): # noqa: E501 + """list_namespace # noqa: E501 + + list or watch objects of kind Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespace_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1NamespaceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespace" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1NamespaceList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_config_map(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_config_map # noqa: E501 + + list or watch objects of kind ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_config_map(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ConfigMapList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_config_map_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_config_map_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_config_map # noqa: E501 + + list or watch objects of kind ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_config_map_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ConfigMapList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_config_map" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_config_map`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ConfigMapList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/configmaps', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_endpoints(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_endpoints # noqa: E501 + + list or watch objects of kind Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_endpoints(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1EndpointsList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_endpoints_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_endpoints_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_endpoints # noqa: E501 + + list or watch objects of kind Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_endpoints_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1EndpointsList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_endpoints" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_endpoints`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1EndpointsList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/endpoints', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_event(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_event # noqa: E501 + + list or watch objects of kind Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_event(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CoreV1EventList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_event_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_event_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_event # noqa: E501 + + list or watch objects of kind Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_event_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CoreV1EventList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_event`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "CoreV1EventList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/events', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_limit_range(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_limit_range # noqa: E501 + + list or watch objects of kind LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_limit_range(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1LimitRangeList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_limit_range_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_limit_range_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_limit_range # noqa: E501 + + list or watch objects of kind LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_limit_range_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1LimitRangeList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_limit_range" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_limit_range`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1LimitRangeList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/limitranges', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_persistent_volume_claim(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_persistent_volume_claim # noqa: E501 + + list or watch objects of kind PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_persistent_volume_claim(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolumeClaimList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_persistent_volume_claim_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_persistent_volume_claim_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_persistent_volume_claim # noqa: E501 + + list or watch objects of kind PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_persistent_volume_claim_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolumeClaimList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_persistent_volume_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_persistent_volume_claim`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolumeClaimList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/persistentvolumeclaims', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_pod(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_pod # noqa: E501 + + list or watch objects of kind Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_pod(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_pod_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_pod_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_pod # noqa: E501 + + list or watch objects of kind Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_pod_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_pod" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_pod`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_pod_template(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_pod_template # noqa: E501 + + list or watch objects of kind PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_pod_template(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodTemplateList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_pod_template_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_pod_template_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_pod_template # noqa: E501 + + list or watch objects of kind PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_pod_template_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodTemplateList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_pod_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_pod_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodTemplateList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/podtemplates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_replication_controller(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_replication_controller # noqa: E501 + + list or watch objects of kind ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_replication_controller(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicationControllerList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_replication_controller_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_replication_controller_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_replication_controller # noqa: E501 + + list or watch objects of kind ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_replication_controller_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicationControllerList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_replication_controller" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_replication_controller`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicationControllerList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/replicationcontrollers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_resource_quota(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_quota # noqa: E501 + + list or watch objects of kind ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_quota(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceQuotaList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_resource_quota_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_resource_quota_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_quota # noqa: E501 + + list or watch objects of kind ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_quota_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceQuotaList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_resource_quota" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_resource_quota`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceQuotaList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/resourcequotas', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_secret(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_secret # noqa: E501 + + list or watch objects of kind Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_secret(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1SecretList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_secret_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_secret_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_secret # noqa: E501 + + list or watch objects of kind Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_secret_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1SecretList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_secret" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_secret`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1SecretList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/secrets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_service(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_service # noqa: E501 + + list or watch objects of kind Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_service(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_service_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_service_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_service # noqa: E501 + + list or watch objects of kind Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_service_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_service`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_service_account(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_service_account # noqa: E501 + + list or watch objects of kind ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_service_account(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceAccountList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_service_account_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_service_account_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_service_account # noqa: E501 + + list or watch objects of kind ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_service_account_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceAccountList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_service_account" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_service_account`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceAccountList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/serviceaccounts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_node(self, **kwargs): # noqa: E501 + """list_node # noqa: E501 + + list or watch objects of kind Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_node(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1NodeList + """ + kwargs['_return_http_data_only'] = True + return self.list_node_with_http_info(**kwargs) # noqa: E501 + + def list_node_with_http_info(self, **kwargs): # noqa: E501 + """list_node # noqa: E501 + + list or watch objects of kind Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_node_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1NodeList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1NodeList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_persistent_volume(self, **kwargs): # noqa: E501 + """list_persistent_volume # noqa: E501 + + list or watch objects of kind PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_persistent_volume(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolumeList + """ + kwargs['_return_http_data_only'] = True + return self.list_persistent_volume_with_http_info(**kwargs) # noqa: E501 + + def list_persistent_volume_with_http_info(self, **kwargs): # noqa: E501 + """list_persistent_volume # noqa: E501 + + list or watch objects of kind PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_persistent_volume_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolumeList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_persistent_volume" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolumeList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/persistentvolumes', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_persistent_volume_claim_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_persistent_volume_claim_for_all_namespaces # noqa: E501 + + list or watch objects of kind PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_persistent_volume_claim_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolumeClaimList + """ + kwargs['_return_http_data_only'] = True + return self.list_persistent_volume_claim_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_persistent_volume_claim_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_persistent_volume_claim_for_all_namespaces # noqa: E501 + + list or watch objects of kind PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_persistent_volume_claim_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolumeClaimList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_persistent_volume_claim_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolumeClaimList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/persistentvolumeclaims', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_pod_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_pod_for_all_namespaces # noqa: E501 + + list or watch objects of kind Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pod_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodList + """ + kwargs['_return_http_data_only'] = True + return self.list_pod_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_pod_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_pod_for_all_namespaces # noqa: E501 + + list or watch objects of kind Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pod_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_pod_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/pods', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_pod_template_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_pod_template_for_all_namespaces # noqa: E501 + + list or watch objects of kind PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pod_template_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodTemplateList + """ + kwargs['_return_http_data_only'] = True + return self.list_pod_template_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_pod_template_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_pod_template_for_all_namespaces # noqa: E501 + + list or watch objects of kind PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pod_template_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodTemplateList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_pod_template_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodTemplateList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/podtemplates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_replication_controller_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_replication_controller_for_all_namespaces # noqa: E501 + + list or watch objects of kind ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_replication_controller_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicationControllerList + """ + kwargs['_return_http_data_only'] = True + return self.list_replication_controller_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_replication_controller_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_replication_controller_for_all_namespaces # noqa: E501 + + list or watch objects of kind ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_replication_controller_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicationControllerList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_replication_controller_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicationControllerList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/replicationcontrollers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_resource_quota_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_resource_quota_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_quota_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceQuotaList + """ + kwargs['_return_http_data_only'] = True + return self.list_resource_quota_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_resource_quota_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_resource_quota_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_quota_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceQuotaList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_resource_quota_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceQuotaList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/resourcequotas', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_secret_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_secret_for_all_namespaces # noqa: E501 + + list or watch objects of kind Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_secret_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1SecretList + """ + kwargs['_return_http_data_only'] = True + return self.list_secret_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_secret_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_secret_for_all_namespaces # noqa: E501 + + list or watch objects of kind Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_secret_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1SecretList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_secret_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1SecretList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/secrets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_service_account_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_service_account_for_all_namespaces # noqa: E501 + + list or watch objects of kind ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_service_account_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceAccountList + """ + kwargs['_return_http_data_only'] = True + return self.list_service_account_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_service_account_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_service_account_for_all_namespaces # noqa: E501 + + list or watch objects of kind ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_service_account_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceAccountList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_service_account_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceAccountList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/serviceaccounts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_service_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_service_for_all_namespaces # noqa: E501 + + list or watch objects of kind Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_service_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceList + """ + kwargs['_return_http_data_only'] = True + return self.list_service_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_service_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_service_for_all_namespaces # noqa: E501 + + list or watch objects of kind Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_service_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_service_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceList", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/services', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespace(self, name, body, **kwargs): # noqa: E501 + """patch_namespace # noqa: E501 + + partially update the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespace(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Namespace + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespace_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_namespace_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_namespace # noqa: E501 + + partially update the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespace_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Namespace, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespace" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespace`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Namespace", + 201: "V1Namespace", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespace_status(self, name, body, **kwargs): # noqa: E501 + """patch_namespace_status # noqa: E501 + + partially update status of the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespace_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Namespace + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespace_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_namespace_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_namespace_status # noqa: E501 + + partially update status of the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespace_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Namespace, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespace_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespace_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespace_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Namespace", + 201: "V1Namespace", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_config_map(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_config_map # noqa: E501 + + partially update the specified ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_config_map(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ConfigMap (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ConfigMap + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_config_map_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_config_map_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_config_map # noqa: E501 + + partially update the specified ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_config_map_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ConfigMap (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ConfigMap, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_config_map" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_config_map`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_config_map`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_config_map`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ConfigMap", + 201: "V1ConfigMap", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/configmaps/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_endpoints(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_endpoints # noqa: E501 + + partially update the specified Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_endpoints(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Endpoints (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Endpoints + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_endpoints_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_endpoints_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_endpoints # noqa: E501 + + partially update the specified Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_endpoints_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Endpoints (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Endpoints, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_endpoints" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_endpoints`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_endpoints`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_endpoints`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Endpoints", + 201: "V1Endpoints", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/endpoints/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_event(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_event # noqa: E501 + + partially update the specified Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_event(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CoreV1Event + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_event_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_event_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_event # noqa: E501 + + partially update the specified Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_event_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CoreV1Event, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_event`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_event`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_event`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "CoreV1Event", + 201: "CoreV1Event", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/events/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_limit_range(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_limit_range # noqa: E501 + + partially update the specified LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_limit_range(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the LimitRange (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1LimitRange + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_limit_range_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_limit_range_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_limit_range # noqa: E501 + + partially update the specified LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_limit_range_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the LimitRange (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1LimitRange, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_limit_range" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_limit_range`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_limit_range`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_limit_range`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1LimitRange", + 201: "V1LimitRange", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/limitranges/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_persistent_volume_claim(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_persistent_volume_claim # noqa: E501 + + partially update the specified PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_persistent_volume_claim(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolumeClaim + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_persistent_volume_claim_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_persistent_volume_claim_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_persistent_volume_claim # noqa: E501 + + partially update the specified PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_persistent_volume_claim_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolumeClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_persistent_volume_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_persistent_volume_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_persistent_volume_claim`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_persistent_volume_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolumeClaim", + 201: "V1PersistentVolumeClaim", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_persistent_volume_claim_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_persistent_volume_claim_status # noqa: E501 + + partially update status of the specified PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_persistent_volume_claim_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolumeClaim + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_persistent_volume_claim_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_persistent_volume_claim_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_persistent_volume_claim_status # noqa: E501 + + partially update status of the specified PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_persistent_volume_claim_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolumeClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_persistent_volume_claim_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_persistent_volume_claim_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_persistent_volume_claim_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_persistent_volume_claim_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolumeClaim", + 201: "V1PersistentVolumeClaim", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_pod(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod # noqa: E501 + + partially update the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_pod_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_pod_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod # noqa: E501 + + partially update the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_pod" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_pod`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_pod`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_pod`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 201: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_pod_ephemeralcontainers(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_ephemeralcontainers # noqa: E501 + + partially update ephemeralcontainers of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_ephemeralcontainers(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_pod_ephemeralcontainers_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_pod_ephemeralcontainers_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_ephemeralcontainers # noqa: E501 + + partially update ephemeralcontainers of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_ephemeralcontainers_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_pod_ephemeralcontainers" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_pod_ephemeralcontainers`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_pod_ephemeralcontainers`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_pod_ephemeralcontainers`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 201: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_pod_resize(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_resize # noqa: E501 + + partially update resize of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_resize(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_pod_resize_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_pod_resize_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_resize # noqa: E501 + + partially update resize of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_resize_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_pod_resize" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_pod_resize`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_pod_resize`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_pod_resize`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 201: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/resize', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_pod_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_status # noqa: E501 + + partially update status of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_pod_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_pod_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_status # noqa: E501 + + partially update status of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_pod_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_pod_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_pod_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_pod_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 201: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_pod_template(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_template # noqa: E501 + + partially update the specified PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_template(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodTemplate + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_pod_template_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_pod_template_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_template # noqa: E501 + + partially update the specified PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_template_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_pod_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_pod_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_pod_template`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_pod_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodTemplate", + 201: "V1PodTemplate", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/podtemplates/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_replication_controller(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_replication_controller # noqa: E501 + + partially update the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_replication_controller(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicationController + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_replication_controller_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_replication_controller_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_replication_controller # noqa: E501 + + partially update the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_replication_controller_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicationController, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_replication_controller" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_replication_controller`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_replication_controller`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_replication_controller`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicationController", + 201: "V1ReplicationController", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_replication_controller_scale(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_replication_controller_scale # noqa: E501 + + partially update scale of the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_replication_controller_scale(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Scale + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_replication_controller_scale_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_replication_controller_scale_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_replication_controller_scale # noqa: E501 + + partially update scale of the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_replication_controller_scale_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Scale, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_replication_controller_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_replication_controller_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_replication_controller_scale`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_replication_controller_scale`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Scale", + 201: "V1Scale", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_replication_controller_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_replication_controller_status # noqa: E501 + + partially update status of the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_replication_controller_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicationController + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_replication_controller_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_replication_controller_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_replication_controller_status # noqa: E501 + + partially update status of the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_replication_controller_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicationController, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_replication_controller_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_replication_controller_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_replication_controller_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_replication_controller_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicationController", + 201: "V1ReplicationController", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_resource_quota(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_quota # noqa: E501 + + partially update the specified ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_quota(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceQuota + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_resource_quota_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_resource_quota_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_quota # noqa: E501 + + partially update the specified ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_quota_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceQuota, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_resource_quota" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_resource_quota`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_resource_quota`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_resource_quota`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceQuota", + 201: "V1ResourceQuota", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/resourcequotas/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_resource_quota_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_quota_status # noqa: E501 + + partially update status of the specified ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_quota_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceQuota + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_resource_quota_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_resource_quota_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_quota_status # noqa: E501 + + partially update status of the specified ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_quota_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceQuota, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_resource_quota_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_resource_quota_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_resource_quota_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_resource_quota_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceQuota", + 201: "V1ResourceQuota", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_secret(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_secret # noqa: E501 + + partially update the specified Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_secret(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Secret (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Secret + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_secret_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_secret_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_secret # noqa: E501 + + partially update the specified Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_secret_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Secret (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Secret, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_secret" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_secret`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_secret`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_secret`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Secret", + 201: "V1Secret", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/secrets/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_service(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_service # noqa: E501 + + partially update the specified Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_service(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Service + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_service_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_service_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_service # noqa: E501 + + partially update the specified Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_service_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Service, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_service`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_service`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_service`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Service", + 201: "V1Service", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_service_account(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_service_account # noqa: E501 + + partially update the specified ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_service_account(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceAccount (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceAccount + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_service_account_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_service_account_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_service_account # noqa: E501 + + partially update the specified ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_service_account_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceAccount (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceAccount, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_service_account" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_service_account`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_service_account`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_service_account`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceAccount", + 201: "V1ServiceAccount", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_service_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_service_status # noqa: E501 + + partially update status of the specified Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_service_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Service + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_service_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_service_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_service_status # noqa: E501 + + partially update status of the specified Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_service_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Service, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_service_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_service_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_service_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_service_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Service", + 201: "V1Service", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_node(self, name, body, **kwargs): # noqa: E501 + """patch_node # noqa: E501 + + partially update the specified Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_node(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Node + """ + kwargs['_return_http_data_only'] = True + return self.patch_node_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_node_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_node # noqa: E501 + + partially update the specified Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_node_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Node, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_node`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_node`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Node", + 201: "V1Node", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_node_status(self, name, body, **kwargs): # noqa: E501 + """patch_node_status # noqa: E501 + + partially update status of the specified Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_node_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Node + """ + kwargs['_return_http_data_only'] = True + return self.patch_node_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_node_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_node_status # noqa: E501 + + partially update status of the specified Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_node_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Node, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_node_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_node_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_node_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Node", + 201: "V1Node", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_persistent_volume(self, name, body, **kwargs): # noqa: E501 + """patch_persistent_volume # noqa: E501 + + partially update the specified PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_persistent_volume(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolume + """ + kwargs['_return_http_data_only'] = True + return self.patch_persistent_volume_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_persistent_volume_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_persistent_volume # noqa: E501 + + partially update the specified PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_persistent_volume_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolume, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_persistent_volume" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_persistent_volume`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_persistent_volume`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolume", + 201: "V1PersistentVolume", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/persistentvolumes/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_persistent_volume_status(self, name, body, **kwargs): # noqa: E501 + """patch_persistent_volume_status # noqa: E501 + + partially update status of the specified PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_persistent_volume_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolume + """ + kwargs['_return_http_data_only'] = True + return self.patch_persistent_volume_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_persistent_volume_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_persistent_volume_status # noqa: E501 + + partially update status of the specified PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_persistent_volume_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolume, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_persistent_volume_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_persistent_volume_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_persistent_volume_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolume", + 201: "V1PersistentVolume", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/persistentvolumes/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_component_status(self, name, **kwargs): # noqa: E501 + """read_component_status # noqa: E501 + + read the specified ComponentStatus # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_component_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ComponentStatus (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ComponentStatus + """ + kwargs['_return_http_data_only'] = True + return self.read_component_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_component_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_component_status # noqa: E501 + + read the specified ComponentStatus # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_component_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ComponentStatus (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ComponentStatus, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_component_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_component_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ComponentStatus", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/componentstatuses/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespace(self, name, **kwargs): # noqa: E501 + """read_namespace # noqa: E501 + + read the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespace(name, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Namespace + """ + kwargs['_return_http_data_only'] = True + return self.read_namespace_with_http_info(name, **kwargs) # noqa: E501 + + def read_namespace_with_http_info(self, name, **kwargs): # noqa: E501 + """read_namespace # noqa: E501 + + read the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespace_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Namespace, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespace" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Namespace", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespace_status(self, name, **kwargs): # noqa: E501 + """read_namespace_status # noqa: E501 + + read status of the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespace_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Namespace + """ + kwargs['_return_http_data_only'] = True + return self.read_namespace_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_namespace_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_namespace_status # noqa: E501 + + read status of the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespace_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Namespace, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespace_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespace_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Namespace", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_config_map(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_config_map # noqa: E501 + + read the specified ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_config_map(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ConfigMap (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ConfigMap + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_config_map_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_config_map_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_config_map # noqa: E501 + + read the specified ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_config_map_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ConfigMap (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ConfigMap, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_config_map" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_config_map`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_config_map`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ConfigMap", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/configmaps/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_endpoints(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_endpoints # noqa: E501 + + read the specified Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_endpoints(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Endpoints (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Endpoints + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_endpoints_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_endpoints_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_endpoints # noqa: E501 + + read the specified Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_endpoints_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Endpoints (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Endpoints, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_endpoints" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_endpoints`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_endpoints`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Endpoints", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/endpoints/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_event(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_event # noqa: E501 + + read the specified Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_event(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CoreV1Event + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_event_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_event_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_event # noqa: E501 + + read the specified Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_event_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CoreV1Event, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_event`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_event`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "CoreV1Event", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/events/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_limit_range(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_limit_range # noqa: E501 + + read the specified LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_limit_range(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the LimitRange (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1LimitRange + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_limit_range_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_limit_range_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_limit_range # noqa: E501 + + read the specified LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_limit_range_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the LimitRange (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1LimitRange, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_limit_range" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_limit_range`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_limit_range`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1LimitRange", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/limitranges/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_persistent_volume_claim(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_persistent_volume_claim # noqa: E501 + + read the specified PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_persistent_volume_claim(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolumeClaim + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_persistent_volume_claim_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_persistent_volume_claim_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_persistent_volume_claim # noqa: E501 + + read the specified PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_persistent_volume_claim_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolumeClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_persistent_volume_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_persistent_volume_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_persistent_volume_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolumeClaim", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_persistent_volume_claim_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_persistent_volume_claim_status # noqa: E501 + + read status of the specified PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_persistent_volume_claim_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolumeClaim + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_persistent_volume_claim_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_persistent_volume_claim_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_persistent_volume_claim_status # noqa: E501 + + read status of the specified PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_persistent_volume_claim_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolumeClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_persistent_volume_claim_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_persistent_volume_claim_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_persistent_volume_claim_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolumeClaim", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_pod(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod # noqa: E501 + + read the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_pod_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_pod_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod # noqa: E501 + + read the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_pod" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_pod`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_pod`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_pod_ephemeralcontainers(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_ephemeralcontainers # noqa: E501 + + read ephemeralcontainers of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_ephemeralcontainers(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_pod_ephemeralcontainers_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_pod_ephemeralcontainers_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_ephemeralcontainers # noqa: E501 + + read ephemeralcontainers of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_ephemeralcontainers_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_pod_ephemeralcontainers" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_pod_ephemeralcontainers`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_pod_ephemeralcontainers`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_pod_log(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_log # noqa: E501 + + read log of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_log(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param container: The container for which to stream logs. Defaults to only container if there is one container in the pod. + :type container: str + :param follow: Follow the log stream of the pod. Defaults to false. + :type follow: bool + :param insecure_skip_tls_verify_backend: insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real kubelet. If the kubelet is configured to verify the apiserver's TLS credentials, it does not mean the connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept the actual log data coming from the real kubelet). + :type insecure_skip_tls_verify_backend: bool + :param limit_bytes: If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit. + :type limit_bytes: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param previous: Return previous terminated container logs. Defaults to false. + :type previous: bool + :param since_seconds: A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified. + :type since_seconds: int + :param stream: Specify which container log stream to return to the client. Acceptable values are \"All\", \"Stdout\" and \"Stderr\". If not specified, \"All\" is used, and both stdout and stderr are returned interleaved. Note that when \"TailLines\" is specified, \"Stream\" can only be set to nil or \"All\". + :type stream: str + :param tail_lines: If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime. Note that when \"TailLines\" is specified, \"Stream\" can only be set to nil or \"All\". + :type tail_lines: int + :param timestamps: If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false. + :type timestamps: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_pod_log_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_pod_log_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_log # noqa: E501 + + read log of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_log_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param container: The container for which to stream logs. Defaults to only container if there is one container in the pod. + :type container: str + :param follow: Follow the log stream of the pod. Defaults to false. + :type follow: bool + :param insecure_skip_tls_verify_backend: insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real kubelet. If the kubelet is configured to verify the apiserver's TLS credentials, it does not mean the connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept the actual log data coming from the real kubelet). + :type insecure_skip_tls_verify_backend: bool + :param limit_bytes: If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit. + :type limit_bytes: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param previous: Return previous terminated container logs. Defaults to false. + :type previous: bool + :param since_seconds: A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified. + :type since_seconds: int + :param stream: Specify which container log stream to return to the client. Acceptable values are \"All\", \"Stdout\" and \"Stderr\". If not specified, \"All\" is used, and both stdout and stderr are returned interleaved. Note that when \"TailLines\" is specified, \"Stream\" can only be set to nil or \"All\". + :type stream: str + :param tail_lines: If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime. Note that when \"TailLines\" is specified, \"Stream\" can only be set to nil or \"All\". + :type tail_lines: int + :param timestamps: If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false. + :type timestamps: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'container', + 'follow', + 'insecure_skip_tls_verify_backend', + 'limit_bytes', + 'pretty', + 'previous', + 'since_seconds', + 'stream', + 'tail_lines', + 'timestamps' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_pod_log" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_pod_log`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_pod_log`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('container') is not None: # noqa: E501 + query_params.append(('container', local_var_params['container'])) # noqa: E501 + if local_var_params.get('follow') is not None: # noqa: E501 + query_params.append(('follow', local_var_params['follow'])) # noqa: E501 + if local_var_params.get('insecure_skip_tls_verify_backend') is not None: # noqa: E501 + query_params.append(('insecureSkipTLSVerifyBackend', local_var_params['insecure_skip_tls_verify_backend'])) # noqa: E501 + if local_var_params.get('limit_bytes') is not None: # noqa: E501 + query_params.append(('limitBytes', local_var_params['limit_bytes'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('previous') is not None: # noqa: E501 + query_params.append(('previous', local_var_params['previous'])) # noqa: E501 + if local_var_params.get('since_seconds') is not None: # noqa: E501 + query_params.append(('sinceSeconds', local_var_params['since_seconds'])) # noqa: E501 + if local_var_params.get('stream') is not None: # noqa: E501 + query_params.append(('stream', local_var_params['stream'])) # noqa: E501 + if local_var_params.get('tail_lines') is not None: # noqa: E501 + query_params.append(('tailLines', local_var_params['tail_lines'])) # noqa: E501 + if local_var_params.get('timestamps') is not None: # noqa: E501 + query_params.append(('timestamps', local_var_params['timestamps'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['text/plain', 'application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/log', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_pod_resize(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_resize # noqa: E501 + + read resize of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_resize(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_pod_resize_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_pod_resize_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_resize # noqa: E501 + + read resize of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_resize_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_pod_resize" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_pod_resize`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_pod_resize`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/resize', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_pod_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_status # noqa: E501 + + read status of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_pod_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_pod_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_status # noqa: E501 + + read status of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_pod_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_pod_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_pod_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_pod_template(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_template # noqa: E501 + + read the specified PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_template(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodTemplate + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_pod_template_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_pod_template_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_template # noqa: E501 + + read the specified PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_template_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_pod_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_pod_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_pod_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodTemplate", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/podtemplates/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_replication_controller(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_replication_controller # noqa: E501 + + read the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_replication_controller(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicationController + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_replication_controller_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_replication_controller_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_replication_controller # noqa: E501 + + read the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_replication_controller_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicationController, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_replication_controller" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_replication_controller`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_replication_controller`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicationController", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_replication_controller_scale(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_replication_controller_scale # noqa: E501 + + read scale of the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_replication_controller_scale(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Scale + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_replication_controller_scale_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_replication_controller_scale_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_replication_controller_scale # noqa: E501 + + read scale of the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_replication_controller_scale_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Scale, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_replication_controller_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_replication_controller_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_replication_controller_scale`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Scale", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_replication_controller_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_replication_controller_status # noqa: E501 + + read status of the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_replication_controller_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicationController + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_replication_controller_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_replication_controller_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_replication_controller_status # noqa: E501 + + read status of the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_replication_controller_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicationController, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_replication_controller_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_replication_controller_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_replication_controller_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicationController", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_resource_quota(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_quota # noqa: E501 + + read the specified ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_quota(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceQuota + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_resource_quota_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_resource_quota_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_quota # noqa: E501 + + read the specified ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_quota_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceQuota, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_resource_quota" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_resource_quota`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_resource_quota`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceQuota", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/resourcequotas/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_resource_quota_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_quota_status # noqa: E501 + + read status of the specified ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_quota_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceQuota + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_resource_quota_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_resource_quota_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_quota_status # noqa: E501 + + read status of the specified ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_quota_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceQuota, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_resource_quota_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_resource_quota_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_resource_quota_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceQuota", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_secret(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_secret # noqa: E501 + + read the specified Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_secret(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Secret (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Secret + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_secret_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_secret_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_secret # noqa: E501 + + read the specified Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_secret_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Secret (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Secret, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_secret" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_secret`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_secret`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Secret", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/secrets/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_service(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_service # noqa: E501 + + read the specified Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_service(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Service + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_service_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_service_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_service # noqa: E501 + + read the specified Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_service_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Service, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_service`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_service`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Service", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_service_account(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_service_account # noqa: E501 + + read the specified ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_service_account(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceAccount (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceAccount + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_service_account_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_service_account_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_service_account # noqa: E501 + + read the specified ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_service_account_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceAccount (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceAccount, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_service_account" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_service_account`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_service_account`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceAccount", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_service_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_service_status # noqa: E501 + + read status of the specified Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_service_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Service + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_service_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_service_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_service_status # noqa: E501 + + read status of the specified Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_service_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Service, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_service_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_service_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_service_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Service", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_node(self, name, **kwargs): # noqa: E501 + """read_node # noqa: E501 + + read the specified Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_node(name, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Node + """ + kwargs['_return_http_data_only'] = True + return self.read_node_with_http_info(name, **kwargs) # noqa: E501 + + def read_node_with_http_info(self, name, **kwargs): # noqa: E501 + """read_node # noqa: E501 + + read the specified Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_node_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Node, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_node`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Node", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_node_status(self, name, **kwargs): # noqa: E501 + """read_node_status # noqa: E501 + + read status of the specified Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_node_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Node + """ + kwargs['_return_http_data_only'] = True + return self.read_node_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_node_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_node_status # noqa: E501 + + read status of the specified Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_node_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Node, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_node_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_node_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Node", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_persistent_volume(self, name, **kwargs): # noqa: E501 + """read_persistent_volume # noqa: E501 + + read the specified PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_persistent_volume(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolume + """ + kwargs['_return_http_data_only'] = True + return self.read_persistent_volume_with_http_info(name, **kwargs) # noqa: E501 + + def read_persistent_volume_with_http_info(self, name, **kwargs): # noqa: E501 + """read_persistent_volume # noqa: E501 + + read the specified PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_persistent_volume_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolume, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_persistent_volume" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_persistent_volume`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolume", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/persistentvolumes/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_persistent_volume_status(self, name, **kwargs): # noqa: E501 + """read_persistent_volume_status # noqa: E501 + + read status of the specified PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_persistent_volume_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolume + """ + kwargs['_return_http_data_only'] = True + return self.read_persistent_volume_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_persistent_volume_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_persistent_volume_status # noqa: E501 + + read status of the specified PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_persistent_volume_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolume, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_persistent_volume_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_persistent_volume_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolume", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/persistentvolumes/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespace(self, name, body, **kwargs): # noqa: E501 + """replace_namespace # noqa: E501 + + replace the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespace(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param body: (required) + :type body: V1Namespace + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Namespace + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespace_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_namespace_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_namespace # noqa: E501 + + replace the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespace_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param body: (required) + :type body: V1Namespace + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Namespace, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespace" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespace`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespace`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Namespace", + 201: "V1Namespace", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespace_finalize(self, name, body, **kwargs): # noqa: E501 + """replace_namespace_finalize # noqa: E501 + + replace finalize of the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespace_finalize(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param body: (required) + :type body: V1Namespace + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Namespace + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespace_finalize_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_namespace_finalize_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_namespace_finalize # noqa: E501 + + replace finalize of the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespace_finalize_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param body: (required) + :type body: V1Namespace + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Namespace, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespace_finalize" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespace_finalize`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespace_finalize`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Namespace", + 201: "V1Namespace", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{name}/finalize', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespace_status(self, name, body, **kwargs): # noqa: E501 + """replace_namespace_status # noqa: E501 + + replace status of the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespace_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param body: (required) + :type body: V1Namespace + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Namespace + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespace_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_namespace_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_namespace_status # noqa: E501 + + replace status of the specified Namespace # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespace_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Namespace (required) + :type name: str + :param body: (required) + :type body: V1Namespace + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Namespace, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespace_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespace_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespace_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Namespace", + 201: "V1Namespace", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_config_map(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_config_map # noqa: E501 + + replace the specified ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_config_map(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ConfigMap (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ConfigMap + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ConfigMap + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_config_map_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_config_map_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_config_map # noqa: E501 + + replace the specified ConfigMap # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_config_map_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ConfigMap (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ConfigMap + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ConfigMap, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_config_map" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_config_map`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_config_map`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_config_map`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ConfigMap", + 201: "V1ConfigMap", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/configmaps/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_endpoints(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_endpoints # noqa: E501 + + replace the specified Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_endpoints(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Endpoints (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Endpoints + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Endpoints + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_endpoints_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_endpoints_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_endpoints # noqa: E501 + + replace the specified Endpoints # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_endpoints_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Endpoints (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Endpoints + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Endpoints, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_endpoints" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_endpoints`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_endpoints`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_endpoints`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Endpoints", + 201: "V1Endpoints", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/endpoints/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_event(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_event # noqa: E501 + + replace the specified Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_event(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: CoreV1Event + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: CoreV1Event + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_event_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_event_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_event # noqa: E501 + + replace the specified Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_event_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: CoreV1Event + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(CoreV1Event, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_event`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_event`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_event`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "CoreV1Event", + 201: "CoreV1Event", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/events/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_limit_range(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_limit_range # noqa: E501 + + replace the specified LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_limit_range(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the LimitRange (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1LimitRange + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1LimitRange + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_limit_range_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_limit_range_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_limit_range # noqa: E501 + + replace the specified LimitRange # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_limit_range_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the LimitRange (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1LimitRange + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1LimitRange, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_limit_range" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_limit_range`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_limit_range`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_limit_range`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1LimitRange", + 201: "V1LimitRange", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/limitranges/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_persistent_volume_claim(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_persistent_volume_claim # noqa: E501 + + replace the specified PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_persistent_volume_claim(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PersistentVolumeClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolumeClaim + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_persistent_volume_claim_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_persistent_volume_claim_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_persistent_volume_claim # noqa: E501 + + replace the specified PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_persistent_volume_claim_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PersistentVolumeClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolumeClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_persistent_volume_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_persistent_volume_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_persistent_volume_claim`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_persistent_volume_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolumeClaim", + 201: "V1PersistentVolumeClaim", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_persistent_volume_claim_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_persistent_volume_claim_status # noqa: E501 + + replace status of the specified PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_persistent_volume_claim_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PersistentVolumeClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolumeClaim + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_persistent_volume_claim_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_persistent_volume_claim_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_persistent_volume_claim_status # noqa: E501 + + replace status of the specified PersistentVolumeClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_persistent_volume_claim_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolumeClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PersistentVolumeClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolumeClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_persistent_volume_claim_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_persistent_volume_claim_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_persistent_volume_claim_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_persistent_volume_claim_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolumeClaim", + 201: "V1PersistentVolumeClaim", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_pod(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod # noqa: E501 + + replace the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Pod + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_pod_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_pod_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod # noqa: E501 + + replace the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Pod + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_pod" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_pod`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_pod`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_pod`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 201: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_pod_ephemeralcontainers(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_ephemeralcontainers # noqa: E501 + + replace ephemeralcontainers of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_ephemeralcontainers(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Pod + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_pod_ephemeralcontainers_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_pod_ephemeralcontainers_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_ephemeralcontainers # noqa: E501 + + replace ephemeralcontainers of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_ephemeralcontainers_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Pod + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_pod_ephemeralcontainers" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_pod_ephemeralcontainers`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_pod_ephemeralcontainers`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_pod_ephemeralcontainers`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 201: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_pod_resize(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_resize # noqa: E501 + + replace resize of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_resize(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Pod + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_pod_resize_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_pod_resize_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_resize # noqa: E501 + + replace resize of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_resize_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Pod + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_pod_resize" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_pod_resize`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_pod_resize`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_pod_resize`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 201: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/resize', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_pod_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_status # noqa: E501 + + replace status of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Pod + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Pod + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_pod_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_pod_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_status # noqa: E501 + + replace status of the specified Pod # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Pod (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Pod + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Pod, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_pod_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_pod_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_pod_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_pod_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Pod", + 201: "V1Pod", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/pods/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_pod_template(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_template # noqa: E501 + + replace the specified PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_template(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PodTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodTemplate + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_pod_template_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_pod_template_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_template # noqa: E501 + + replace the specified PodTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_template_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PodTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_pod_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_pod_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_pod_template`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_pod_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodTemplate", + 201: "V1PodTemplate", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/podtemplates/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_replication_controller(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_replication_controller # noqa: E501 + + replace the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_replication_controller(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ReplicationController + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicationController + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_replication_controller_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_replication_controller_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_replication_controller # noqa: E501 + + replace the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_replication_controller_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ReplicationController + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicationController, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_replication_controller" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_replication_controller`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_replication_controller`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_replication_controller`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicationController", + 201: "V1ReplicationController", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_replication_controller_scale(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_replication_controller_scale # noqa: E501 + + replace scale of the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_replication_controller_scale(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Scale + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Scale + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_replication_controller_scale_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_replication_controller_scale_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_replication_controller_scale # noqa: E501 + + replace scale of the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_replication_controller_scale_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Scale (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Scale + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Scale, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_replication_controller_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_replication_controller_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_replication_controller_scale`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_replication_controller_scale`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Scale", + 201: "V1Scale", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_replication_controller_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_replication_controller_status # noqa: E501 + + replace status of the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_replication_controller_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ReplicationController + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ReplicationController + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_replication_controller_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_replication_controller_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_replication_controller_status # noqa: E501 + + replace status of the specified ReplicationController # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_replication_controller_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ReplicationController (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ReplicationController + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ReplicationController, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_replication_controller_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_replication_controller_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_replication_controller_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_replication_controller_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ReplicationController", + 201: "V1ReplicationController", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_resource_quota(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_quota # noqa: E501 + + replace the specified ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_quota(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ResourceQuota + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceQuota + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_resource_quota_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_resource_quota_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_quota # noqa: E501 + + replace the specified ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_quota_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ResourceQuota + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceQuota, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_resource_quota" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_resource_quota`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_resource_quota`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_resource_quota`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceQuota", + 201: "V1ResourceQuota", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/resourcequotas/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_resource_quota_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_quota_status # noqa: E501 + + replace status of the specified ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_quota_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ResourceQuota + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceQuota + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_resource_quota_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_resource_quota_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_quota_status # noqa: E501 + + replace status of the specified ResourceQuota # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_quota_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceQuota (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ResourceQuota + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceQuota, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_resource_quota_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_resource_quota_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_resource_quota_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_resource_quota_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceQuota", + 201: "V1ResourceQuota", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_secret(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_secret # noqa: E501 + + replace the specified Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_secret(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Secret (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Secret + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Secret + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_secret_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_secret_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_secret # noqa: E501 + + replace the specified Secret # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_secret_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Secret (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Secret + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Secret, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_secret" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_secret`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_secret`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_secret`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Secret", + 201: "V1Secret", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/secrets/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_service(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_service # noqa: E501 + + replace the specified Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_service(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Service + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Service + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_service_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_service_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_service # noqa: E501 + + replace the specified Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_service_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Service + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Service, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_service" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_service`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_service`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_service`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Service", + 201: "V1Service", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_service_account(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_service_account # noqa: E501 + + replace the specified ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_service_account(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceAccount (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ServiceAccount + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceAccount + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_service_account_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_service_account_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_service_account # noqa: E501 + + replace the specified ServiceAccount # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_service_account_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceAccount (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ServiceAccount + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceAccount, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_service_account" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_service_account`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_service_account`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_service_account`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceAccount", + 201: "V1ServiceAccount", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_service_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_service_status # noqa: E501 + + replace status of the specified Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_service_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Service + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Service + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_service_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_service_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_service_status # noqa: E501 + + replace status of the specified Service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_service_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Service (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Service + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Service, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_service_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_service_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_service_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_service_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Service", + 201: "V1Service", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/namespaces/{namespace}/services/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_node(self, name, body, **kwargs): # noqa: E501 + """replace_node # noqa: E501 + + replace the specified Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_node(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param body: (required) + :type body: V1Node + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Node + """ + kwargs['_return_http_data_only'] = True + return self.replace_node_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_node_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_node # noqa: E501 + + replace the specified Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_node_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param body: (required) + :type body: V1Node + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Node, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_node`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_node`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Node", + 201: "V1Node", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_node_status(self, name, body, **kwargs): # noqa: E501 + """replace_node_status # noqa: E501 + + replace status of the specified Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_node_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param body: (required) + :type body: V1Node + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Node + """ + kwargs['_return_http_data_only'] = True + return self.replace_node_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_node_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_node_status # noqa: E501 + + replace status of the specified Node # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_node_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Node (required) + :type name: str + :param body: (required) + :type body: V1Node + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Node, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_node_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_node_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_node_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Node", + 201: "V1Node", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/nodes/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_persistent_volume(self, name, body, **kwargs): # noqa: E501 + """replace_persistent_volume # noqa: E501 + + replace the specified PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_persistent_volume(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param body: (required) + :type body: V1PersistentVolume + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolume + """ + kwargs['_return_http_data_only'] = True + return self.replace_persistent_volume_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_persistent_volume_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_persistent_volume # noqa: E501 + + replace the specified PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_persistent_volume_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param body: (required) + :type body: V1PersistentVolume + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolume, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_persistent_volume" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_persistent_volume`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_persistent_volume`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolume", + 201: "V1PersistentVolume", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/persistentvolumes/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_persistent_volume_status(self, name, body, **kwargs): # noqa: E501 + """replace_persistent_volume_status # noqa: E501 + + replace status of the specified PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_persistent_volume_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param body: (required) + :type body: V1PersistentVolume + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PersistentVolume + """ + kwargs['_return_http_data_only'] = True + return self.replace_persistent_volume_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_persistent_volume_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_persistent_volume_status # noqa: E501 + + replace status of the specified PersistentVolume # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_persistent_volume_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PersistentVolume (required) + :type name: str + :param body: (required) + :type body: V1PersistentVolume + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PersistentVolume, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_persistent_volume_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_persistent_volume_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_persistent_volume_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PersistentVolume", + 201: "V1PersistentVolume", + 401: None, + } + + return self.api_client.call_api( + '/api/v1/persistentvolumes/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/custom_objects_api.py b/kubernetes_asyncio/client/api/custom_objects_api.py new file mode 100644 index 0000000000..32309df81d --- /dev/null +++ b/kubernetes_asyncio/client/api/custom_objects_api.py @@ -0,0 +1,5708 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class CustomObjectsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_cluster_custom_object(self, group, version, plural, body, **kwargs): # noqa: E501 + """create_cluster_custom_object # noqa: E501 + + Creates a cluster scoped Custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_cluster_custom_object(group, version, plural, body, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param body: The JSON schema of the Resource to create. (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.create_cluster_custom_object_with_http_info(group, version, plural, body, **kwargs) # noqa: E501 + + def create_cluster_custom_object_with_http_info(self, group, version, plural, body, **kwargs): # noqa: E501 + """create_cluster_custom_object # noqa: E501 + + Creates a cluster scoped Custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_cluster_custom_object_with_http_info(group, version, plural, body, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param body: The JSON schema of the Resource to create. (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'plural', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_cluster_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `create_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `create_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `create_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_cluster_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 201: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{plural}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_custom_object(self, group, version, namespace, plural, body, **kwargs): # noqa: E501 + """create_namespaced_custom_object # noqa: E501 + + Creates a namespace scoped Custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_custom_object(group, version, namespace, plural, body, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param body: The JSON schema of the Resource to create. (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_custom_object_with_http_info(group, version, namespace, plural, body, **kwargs) # noqa: E501 + + def create_namespaced_custom_object_with_http_info(self, group, version, namespace, plural, body, **kwargs): # noqa: E501 + """create_namespaced_custom_object # noqa: E501 + + Creates a namespace scoped Custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_custom_object_with_http_info(group, version, namespace, plural, body, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param body: The JSON schema of the Resource to create. (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'namespace', + 'plural', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `create_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `create_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `create_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 201: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/namespaces/{namespace}/{plural}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_cluster_custom_object(self, group, version, plural, name, **kwargs): # noqa: E501 + """delete_cluster_custom_object # noqa: E501 + + Deletes the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_cluster_custom_object(group, version, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom object's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. + :type propagation_policy: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.delete_cluster_custom_object_with_http_info(group, version, plural, name, **kwargs) # noqa: E501 + + def delete_cluster_custom_object_with_http_info(self, group, version, plural, name, **kwargs): # noqa: E501 + """delete_cluster_custom_object # noqa: E501 + + Deletes the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_cluster_custom_object_with_http_info(group, version, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom object's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. + :type propagation_policy: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'plural', + 'name', + 'grace_period_seconds', + 'orphan_dependents', + 'propagation_policy', + 'dry_run', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_cluster_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `delete_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `delete_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `delete_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_cluster_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{plural}/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_cluster_custom_object(self, group, version, plural, **kwargs): # noqa: E501 + """delete_collection_cluster_custom_object # noqa: E501 + + Delete collection of cluster scoped custom objects # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_cluster_custom_object(group, version, plural, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. + :type propagation_policy: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_cluster_custom_object_with_http_info(group, version, plural, **kwargs) # noqa: E501 + + def delete_collection_cluster_custom_object_with_http_info(self, group, version, plural, **kwargs): # noqa: E501 + """delete_collection_cluster_custom_object # noqa: E501 + + Delete collection of cluster scoped custom objects # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_cluster_custom_object_with_http_info(group, version, plural, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. + :type propagation_policy: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'plural', + 'pretty', + 'label_selector', + 'grace_period_seconds', + 'orphan_dependents', + 'propagation_policy', + 'dry_run', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_cluster_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `delete_collection_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `delete_collection_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `delete_collection_cluster_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{plural}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_custom_object(self, group, version, namespace, plural, **kwargs): # noqa: E501 + """delete_collection_namespaced_custom_object # noqa: E501 + + Delete collection of namespace scoped custom objects # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_custom_object(group, version, namespace, plural, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. + :type propagation_policy: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_custom_object_with_http_info(group, version, namespace, plural, **kwargs) # noqa: E501 + + def delete_collection_namespaced_custom_object_with_http_info(self, group, version, namespace, plural, **kwargs): # noqa: E501 + """delete_collection_namespaced_custom_object # noqa: E501 + + Delete collection of namespace scoped custom objects # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_custom_object_with_http_info(group, version, namespace, plural, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. + :type propagation_policy: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'namespace', + 'plural', + 'pretty', + 'label_selector', + 'grace_period_seconds', + 'orphan_dependents', + 'propagation_policy', + 'dry_run', + 'field_selector', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `delete_collection_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `delete_collection_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `delete_collection_namespaced_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/namespaces/{namespace}/{plural}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_custom_object(self, group, version, namespace, plural, name, **kwargs): # noqa: E501 + """delete_namespaced_custom_object # noqa: E501 + + Deletes the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_custom_object(group, version, namespace, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. + :type propagation_policy: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, **kwargs) # noqa: E501 + + def delete_namespaced_custom_object_with_http_info(self, group, version, namespace, plural, name, **kwargs): # noqa: E501 + """delete_namespaced_custom_object # noqa: E501 + + Deletes the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. + :type propagation_policy: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'namespace', + 'plural', + 'name', + 'grace_period_seconds', + 'orphan_dependents', + 'propagation_policy', + 'dry_run', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `delete_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `delete_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `delete_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, group, version, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(group, version, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(group, version, **kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, group, version, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(group, version, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `get_api_resources`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `get_api_resources`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_cluster_custom_object(self, group, version, plural, name, **kwargs): # noqa: E501 + """get_cluster_custom_object # noqa: E501 + + Returns a cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_cluster_custom_object(group, version, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom object's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.get_cluster_custom_object_with_http_info(group, version, plural, name, **kwargs) # noqa: E501 + + def get_cluster_custom_object_with_http_info(self, group, version, plural, name, **kwargs): # noqa: E501 + """get_cluster_custom_object # noqa: E501 + + Returns a cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_cluster_custom_object_with_http_info(group, version, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom object's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'plural', + 'name' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_cluster_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `get_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `get_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `get_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `get_cluster_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{plural}/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_cluster_custom_object_scale(self, group, version, plural, name, **kwargs): # noqa: E501 + """get_cluster_custom_object_scale # noqa: E501 + + read scale of the specified custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_cluster_custom_object_scale(group, version, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.get_cluster_custom_object_scale_with_http_info(group, version, plural, name, **kwargs) # noqa: E501 + + def get_cluster_custom_object_scale_with_http_info(self, group, version, plural, name, **kwargs): # noqa: E501 + """get_cluster_custom_object_scale # noqa: E501 + + read scale of the specified custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_cluster_custom_object_scale_with_http_info(group, version, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'plural', + 'name' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_cluster_custom_object_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `get_cluster_custom_object_scale`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `get_cluster_custom_object_scale`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `get_cluster_custom_object_scale`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `get_cluster_custom_object_scale`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{plural}/{name}/scale', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_cluster_custom_object_status(self, group, version, plural, name, **kwargs): # noqa: E501 + """get_cluster_custom_object_status # noqa: E501 + + read status of the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_cluster_custom_object_status(group, version, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.get_cluster_custom_object_status_with_http_info(group, version, plural, name, **kwargs) # noqa: E501 + + def get_cluster_custom_object_status_with_http_info(self, group, version, plural, name, **kwargs): # noqa: E501 + """get_cluster_custom_object_status # noqa: E501 + + read status of the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_cluster_custom_object_status_with_http_info(group, version, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'plural', + 'name' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_cluster_custom_object_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `get_cluster_custom_object_status`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `get_cluster_custom_object_status`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `get_cluster_custom_object_status`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `get_cluster_custom_object_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{plural}/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_namespaced_custom_object(self, group, version, namespace, plural, name, **kwargs): # noqa: E501 + """get_namespaced_custom_object # noqa: E501 + + Returns a namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_namespaced_custom_object(group, version, namespace, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.get_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, **kwargs) # noqa: E501 + + def get_namespaced_custom_object_with_http_info(self, group, version, namespace, plural, name, **kwargs): # noqa: E501 + """get_namespaced_custom_object # noqa: E501 + + Returns a namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'namespace', + 'plural', + 'name' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_namespaced_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `get_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `get_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `get_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `get_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `get_namespaced_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_namespaced_custom_object_scale(self, group, version, namespace, plural, name, **kwargs): # noqa: E501 + """get_namespaced_custom_object_scale # noqa: E501 + + read scale of the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_namespaced_custom_object_scale(group, version, namespace, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.get_namespaced_custom_object_scale_with_http_info(group, version, namespace, plural, name, **kwargs) # noqa: E501 + + def get_namespaced_custom_object_scale_with_http_info(self, group, version, namespace, plural, name, **kwargs): # noqa: E501 + """get_namespaced_custom_object_scale # noqa: E501 + + read scale of the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_namespaced_custom_object_scale_with_http_info(group, version, namespace, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'namespace', + 'plural', + 'name' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_namespaced_custom_object_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `get_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `get_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `get_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `get_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `get_namespaced_custom_object_scale`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_namespaced_custom_object_status(self, group, version, namespace, plural, name, **kwargs): # noqa: E501 + """get_namespaced_custom_object_status # noqa: E501 + + read status of the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_namespaced_custom_object_status(group, version, namespace, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.get_namespaced_custom_object_status_with_http_info(group, version, namespace, plural, name, **kwargs) # noqa: E501 + + def get_namespaced_custom_object_status_with_http_info(self, group, version, namespace, plural, name, **kwargs): # noqa: E501 + """get_namespaced_custom_object_status # noqa: E501 + + read status of the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_namespaced_custom_object_status_with_http_info(group, version, namespace, plural, name, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'namespace', + 'plural', + 'name' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_namespaced_custom_object_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `get_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `get_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `get_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `get_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `get_namespaced_custom_object_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_cluster_custom_object(self, group, version, plural, **kwargs): # noqa: E501 + """list_cluster_custom_object # noqa: E501 + + list or watch cluster scoped custom objects # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_cluster_custom_object(group, version, plural, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.list_cluster_custom_object_with_http_info(group, version, plural, **kwargs) # noqa: E501 + + def list_cluster_custom_object_with_http_info(self, group, version, plural, **kwargs): # noqa: E501 + """list_cluster_custom_object # noqa: E501 + + list or watch cluster scoped custom objects # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_cluster_custom_object_with_http_info(group, version, plural, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'plural', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_cluster_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `list_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `list_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `list_cluster_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/json;stream=watch']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{plural}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_custom_object_for_all_namespaces(self, group, version, resource_plural, **kwargs): # noqa: E501 + """list_custom_object_for_all_namespaces # noqa: E501 + + list or watch namespace scoped custom objects # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_custom_object_for_all_namespaces(group, version, resource_plural, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param resource_plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type resource_plural: str + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.list_custom_object_for_all_namespaces_with_http_info(group, version, resource_plural, **kwargs) # noqa: E501 + + def list_custom_object_for_all_namespaces_with_http_info(self, group, version, resource_plural, **kwargs): # noqa: E501 + """list_custom_object_for_all_namespaces # noqa: E501 + + list or watch namespace scoped custom objects # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_custom_object_for_all_namespaces_with_http_info(group, version, resource_plural, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param resource_plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type resource_plural: str + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'resource_plural', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_custom_object_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `list_custom_object_for_all_namespaces`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `list_custom_object_for_all_namespaces`") # noqa: E501 + # verify the required parameter 'resource_plural' is set + if self.api_client.client_side_validation and local_var_params.get('resource_plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `resource_plural` when calling `list_custom_object_for_all_namespaces`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'resource_plural' in local_var_params: + path_params['resource_plural'] = local_var_params['resource_plural'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/json;stream=watch']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{resource_plural}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_custom_object(self, group, version, namespace, plural, **kwargs): # noqa: E501 + """list_namespaced_custom_object # noqa: E501 + + list or watch namespace scoped custom objects # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_custom_object(group, version, namespace, plural, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_custom_object_with_http_info(group, version, namespace, plural, **kwargs) # noqa: E501 + + def list_namespaced_custom_object_with_http_info(self, group, version, namespace, plural, **kwargs): # noqa: E501 + """list_namespaced_custom_object # noqa: E501 + + list or watch namespace scoped custom objects # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_custom_object_with_http_info(group, version, namespace, plural, async_req=True) + >>> result = thread.get() + + :param group: The custom resource's group name (required) + :type group: str + :param version: The custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: The custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param pretty: If 'true', then the output is pretty printed. + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'namespace', + 'plural', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `list_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `list_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `list_namespaced_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/json;stream=watch']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/namespaces/{namespace}/{plural}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_cluster_custom_object(self, group, version, plural, name, body, **kwargs): # noqa: E501 + """patch_cluster_custom_object # noqa: E501 + + patch the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_custom_object(group, version, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom object's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: The JSON schema of the Resource to patch. (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.patch_cluster_custom_object_with_http_info(group, version, plural, name, body, **kwargs) # noqa: E501 + + def patch_cluster_custom_object_with_http_info(self, group, version, plural, name, body, **kwargs): # noqa: E501 + """patch_cluster_custom_object # noqa: E501 + + patch the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_custom_object_with_http_info(group, version, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom object's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: The JSON schema of the Resource to patch. (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'plural', + 'name', + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_cluster_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `patch_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `patch_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `patch_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_cluster_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{plural}/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_cluster_custom_object_scale(self, group, version, plural, name, body, **kwargs): # noqa: E501 + """patch_cluster_custom_object_scale # noqa: E501 + + partially update scale of the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_custom_object_scale(group, version, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.patch_cluster_custom_object_scale_with_http_info(group, version, plural, name, body, **kwargs) # noqa: E501 + + def patch_cluster_custom_object_scale_with_http_info(self, group, version, plural, name, body, **kwargs): # noqa: E501 + """patch_cluster_custom_object_scale # noqa: E501 + + partially update scale of the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_custom_object_scale_with_http_info(group, version, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'plural', + 'name', + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_cluster_custom_object_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `patch_cluster_custom_object_scale`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `patch_cluster_custom_object_scale`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `patch_cluster_custom_object_scale`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_cluster_custom_object_scale`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_cluster_custom_object_scale`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{plural}/{name}/scale', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_cluster_custom_object_status(self, group, version, plural, name, body, **kwargs): # noqa: E501 + """patch_cluster_custom_object_status # noqa: E501 + + partially update status of the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_custom_object_status(group, version, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.patch_cluster_custom_object_status_with_http_info(group, version, plural, name, body, **kwargs) # noqa: E501 + + def patch_cluster_custom_object_status_with_http_info(self, group, version, plural, name, body, **kwargs): # noqa: E501 + """patch_cluster_custom_object_status # noqa: E501 + + partially update status of the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_custom_object_status_with_http_info(group, version, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'plural', + 'name', + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_cluster_custom_object_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `patch_cluster_custom_object_status`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `patch_cluster_custom_object_status`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `patch_cluster_custom_object_status`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_cluster_custom_object_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_cluster_custom_object_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{plural}/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_custom_object(self, group, version, namespace, plural, name, body, **kwargs): # noqa: E501 + """patch_namespaced_custom_object # noqa: E501 + + patch the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_custom_object(group, version, namespace, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: The JSON schema of the Resource to patch. (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, **kwargs) # noqa: E501 + + def patch_namespaced_custom_object_with_http_info(self, group, version, namespace, plural, name, body, **kwargs): # noqa: E501 + """patch_namespaced_custom_object # noqa: E501 + + patch the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: The JSON schema of the Resource to patch. (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'namespace', + 'plural', + 'name', + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `patch_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `patch_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `patch_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_custom_object_scale(self, group, version, namespace, plural, name, body, **kwargs): # noqa: E501 + """patch_namespaced_custom_object_scale # noqa: E501 + + partially update scale of the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_custom_object_scale(group, version, namespace, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_custom_object_scale_with_http_info(group, version, namespace, plural, name, body, **kwargs) # noqa: E501 + + def patch_namespaced_custom_object_scale_with_http_info(self, group, version, namespace, plural, name, body, **kwargs): # noqa: E501 + """patch_namespaced_custom_object_scale # noqa: E501 + + partially update scale of the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_custom_object_scale_with_http_info(group, version, namespace, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'namespace', + 'plural', + 'name', + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_custom_object_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `patch_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `patch_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `patch_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_custom_object_scale`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/apply-patch+yaml'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_custom_object_status(self, group, version, namespace, plural, name, body, **kwargs): # noqa: E501 + """patch_namespaced_custom_object_status # noqa: E501 + + partially update status of the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_custom_object_status(group, version, namespace, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_custom_object_status_with_http_info(group, version, namespace, plural, name, body, **kwargs) # noqa: E501 + + def patch_namespaced_custom_object_status_with_http_info(self, group, version, namespace, plural, name, body, **kwargs): # noqa: E501 + """patch_namespaced_custom_object_status # noqa: E501 + + partially update status of the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_custom_object_status_with_http_info(group, version, namespace, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'namespace', + 'plural', + 'name', + 'body', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_custom_object_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `patch_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `patch_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `patch_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_custom_object_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/apply-patch+yaml'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_cluster_custom_object(self, group, version, plural, name, body, **kwargs): # noqa: E501 + """replace_cluster_custom_object # noqa: E501 + + replace the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_custom_object(group, version, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom object's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: The JSON schema of the Resource to replace. (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.replace_cluster_custom_object_with_http_info(group, version, plural, name, body, **kwargs) # noqa: E501 + + def replace_cluster_custom_object_with_http_info(self, group, version, plural, name, body, **kwargs): # noqa: E501 + """replace_cluster_custom_object # noqa: E501 + + replace the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_custom_object_with_http_info(group, version, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom object's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: The JSON schema of the Resource to replace. (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'plural', + 'name', + 'body', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_cluster_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `replace_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `replace_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `replace_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_cluster_custom_object`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_cluster_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{plural}/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_cluster_custom_object_scale(self, group, version, plural, name, body, **kwargs): # noqa: E501 + """replace_cluster_custom_object_scale # noqa: E501 + + replace scale of the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_custom_object_scale(group, version, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.replace_cluster_custom_object_scale_with_http_info(group, version, plural, name, body, **kwargs) # noqa: E501 + + def replace_cluster_custom_object_scale_with_http_info(self, group, version, plural, name, body, **kwargs): # noqa: E501 + """replace_cluster_custom_object_scale # noqa: E501 + + replace scale of the specified cluster scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_custom_object_scale_with_http_info(group, version, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'plural', + 'name', + 'body', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_cluster_custom_object_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `replace_cluster_custom_object_scale`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `replace_cluster_custom_object_scale`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `replace_cluster_custom_object_scale`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_cluster_custom_object_scale`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_cluster_custom_object_scale`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 201: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{plural}/{name}/scale', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_cluster_custom_object_status(self, group, version, plural, name, body, **kwargs): # noqa: E501 + """replace_cluster_custom_object_status # noqa: E501 + + replace status of the cluster scoped specified custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_custom_object_status(group, version, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.replace_cluster_custom_object_status_with_http_info(group, version, plural, name, body, **kwargs) # noqa: E501 + + def replace_cluster_custom_object_status_with_http_info(self, group, version, plural, name, body, **kwargs): # noqa: E501 + """replace_cluster_custom_object_status # noqa: E501 + + replace status of the cluster scoped specified custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_custom_object_status_with_http_info(group, version, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'plural', + 'name', + 'body', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_cluster_custom_object_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `replace_cluster_custom_object_status`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `replace_cluster_custom_object_status`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `replace_cluster_custom_object_status`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_cluster_custom_object_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_cluster_custom_object_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 201: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/{plural}/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_custom_object(self, group, version, namespace, plural, name, body, **kwargs): # noqa: E501 + """replace_namespaced_custom_object # noqa: E501 + + replace the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_custom_object(group, version, namespace, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: The JSON schema of the Resource to replace. (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, **kwargs) # noqa: E501 + + def replace_namespaced_custom_object_with_http_info(self, group, version, namespace, plural, name, body, **kwargs): # noqa: E501 + """replace_namespaced_custom_object # noqa: E501 + + replace the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: The JSON schema of the Resource to replace. (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'namespace', + 'plural', + 'name', + 'body', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_custom_object" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `replace_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `replace_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `replace_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_custom_object`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_custom_object`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_custom_object_scale(self, group, version, namespace, plural, name, body, **kwargs): # noqa: E501 + """replace_namespaced_custom_object_scale # noqa: E501 + + replace scale of the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_custom_object_scale(group, version, namespace, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_custom_object_scale_with_http_info(group, version, namespace, plural, name, body, **kwargs) # noqa: E501 + + def replace_namespaced_custom_object_scale_with_http_info(self, group, version, namespace, plural, name, body, **kwargs): # noqa: E501 + """replace_namespaced_custom_object_scale # noqa: E501 + + replace scale of the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_custom_object_scale_with_http_info(group, version, namespace, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'namespace', + 'plural', + 'name', + 'body', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_custom_object_scale" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `replace_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `replace_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `replace_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_custom_object_scale`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_custom_object_scale`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 201: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_custom_object_status(self, group, version, namespace, plural, name, body, **kwargs): # noqa: E501 + """replace_namespaced_custom_object_status # noqa: E501 + + replace status of the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_custom_object_status(group, version, namespace, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: object + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_custom_object_status_with_http_info(group, version, namespace, plural, name, body, **kwargs) # noqa: E501 + + def replace_namespaced_custom_object_status_with_http_info(self, group, version, namespace, plural, name, body, **kwargs): # noqa: E501 + """replace_namespaced_custom_object_status # noqa: E501 + + replace status of the specified namespace scoped custom object # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_custom_object_status_with_http_info(group, version, namespace, plural, name, body, async_req=True) + >>> result = thread.get() + + :param group: the custom resource's group (required) + :type group: str + :param version: the custom resource's version (required) + :type version: str + :param namespace: The custom resource's namespace (required) + :type namespace: str + :param plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required) + :type plural: str + :param name: the custom object's name (required) + :type name: str + :param body: (required) + :type body: object + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. (optional) + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'group', + 'version', + 'namespace', + 'plural', + 'name', + 'body', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_custom_object_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'group' is set + if self.api_client.client_side_validation and local_var_params.get('group') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `group` when calling `replace_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and local_var_params.get('version') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `version` when calling `replace_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'plural' is set + if self.api_client.client_side_validation and local_var_params.get('plural') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `plural` when calling `replace_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_custom_object_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_custom_object_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'group' in local_var_params: + path_params['group'] = local_var_params['group'] # noqa: E501 + if 'version' in local_var_params: + path_params['version'] = local_var_params['version'] # noqa: E501 + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + if 'plural' in local_var_params: + path_params['plural'] = local_var_params['plural'] # noqa: E501 + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "object", + 201: "object", + 401: None, + } + + return self.api_client.call_api( + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/discovery_api.py b/kubernetes_asyncio/client/api/discovery_api.py new file mode 100644 index 0000000000..ce39eebfb8 --- /dev/null +++ b/kubernetes_asyncio/client/api/discovery_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class DiscoveryApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/discovery.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/discovery_v1_api.py b/kubernetes_asyncio/client/api/discovery_v1_api.py new file mode 100644 index 0000000000..e6789d2ba5 --- /dev/null +++ b/kubernetes_asyncio/client/api/discovery_v1_api.py @@ -0,0 +1,1748 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class DiscoveryV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_namespaced_endpoint_slice(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_endpoint_slice # noqa: E501 + + create an EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_endpoint_slice(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1EndpointSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1EndpointSlice + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_endpoint_slice_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_endpoint_slice_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_endpoint_slice # noqa: E501 + + create an EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_endpoint_slice_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1EndpointSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1EndpointSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_endpoint_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_endpoint_slice`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_endpoint_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1EndpointSlice", + 201: "V1EndpointSlice", + 202: "V1EndpointSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_endpoint_slice(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_endpoint_slice # noqa: E501 + + delete collection of EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_endpoint_slice(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_endpoint_slice_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_endpoint_slice_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_endpoint_slice # noqa: E501 + + delete collection of EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_endpoint_slice_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_endpoint_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_endpoint_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_endpoint_slice(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_endpoint_slice # noqa: E501 + + delete an EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_endpoint_slice(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the EndpointSlice (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_endpoint_slice_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_endpoint_slice_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_endpoint_slice # noqa: E501 + + delete an EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_endpoint_slice_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the EndpointSlice (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_endpoint_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_endpoint_slice`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_endpoint_slice`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/discovery.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_endpoint_slice_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_endpoint_slice_for_all_namespaces # noqa: E501 + + list or watch objects of kind EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_endpoint_slice_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1EndpointSliceList + """ + kwargs['_return_http_data_only'] = True + return self.list_endpoint_slice_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_endpoint_slice_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_endpoint_slice_for_all_namespaces # noqa: E501 + + list or watch objects of kind EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_endpoint_slice_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1EndpointSliceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_endpoint_slice_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1EndpointSliceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/discovery.k8s.io/v1/endpointslices', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_endpoint_slice(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_endpoint_slice # noqa: E501 + + list or watch objects of kind EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_endpoint_slice(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1EndpointSliceList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_endpoint_slice_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_endpoint_slice_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_endpoint_slice # noqa: E501 + + list or watch objects of kind EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_endpoint_slice_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1EndpointSliceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_endpoint_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_endpoint_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1EndpointSliceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_endpoint_slice(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_endpoint_slice # noqa: E501 + + partially update the specified EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_endpoint_slice(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the EndpointSlice (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1EndpointSlice + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_endpoint_slice_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_endpoint_slice_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_endpoint_slice # noqa: E501 + + partially update the specified EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_endpoint_slice_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the EndpointSlice (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1EndpointSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_endpoint_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_endpoint_slice`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_endpoint_slice`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_endpoint_slice`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1EndpointSlice", + 201: "V1EndpointSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_endpoint_slice(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_endpoint_slice # noqa: E501 + + read the specified EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_endpoint_slice(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the EndpointSlice (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1EndpointSlice + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_endpoint_slice_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_endpoint_slice_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_endpoint_slice # noqa: E501 + + read the specified EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_endpoint_slice_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the EndpointSlice (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1EndpointSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_endpoint_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_endpoint_slice`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_endpoint_slice`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1EndpointSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_endpoint_slice(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_endpoint_slice # noqa: E501 + + replace the specified EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_endpoint_slice(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the EndpointSlice (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1EndpointSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1EndpointSlice + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_endpoint_slice_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_endpoint_slice_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_endpoint_slice # noqa: E501 + + replace the specified EndpointSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_endpoint_slice_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the EndpointSlice (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1EndpointSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1EndpointSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_endpoint_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_endpoint_slice`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_endpoint_slice`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_endpoint_slice`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1EndpointSlice", + 201: "V1EndpointSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/events_api.py b/kubernetes_asyncio/client/api/events_api.py new file mode 100644 index 0000000000..7c7956b24c --- /dev/null +++ b/kubernetes_asyncio/client/api/events_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class EventsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/events.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/events_v1_api.py b/kubernetes_asyncio/client/api/events_v1_api.py new file mode 100644 index 0000000000..b7cad59d65 --- /dev/null +++ b/kubernetes_asyncio/client/api/events_v1_api.py @@ -0,0 +1,1748 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class EventsV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_namespaced_event(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_event # noqa: E501 + + create an Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_event(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: EventsV1Event + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: EventsV1Event + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_event_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_event_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_event # noqa: E501 + + create an Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_event_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: EventsV1Event + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(EventsV1Event, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_event`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_event`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "EventsV1Event", + 201: "EventsV1Event", + 202: "EventsV1Event", + 401: None, + } + + return self.api_client.call_api( + '/apis/events.k8s.io/v1/namespaces/{namespace}/events', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_event(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_event # noqa: E501 + + delete collection of Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_event(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_event_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_event_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_event # noqa: E501 + + delete collection of Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_event_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_event`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/events.k8s.io/v1/namespaces/{namespace}/events', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_event(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_event # noqa: E501 + + delete an Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_event(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_event_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_event_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_event # noqa: E501 + + delete an Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_event_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_event`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_event`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/events.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_event_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_event_for_all_namespaces # noqa: E501 + + list or watch objects of kind Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_event_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: EventsV1EventList + """ + kwargs['_return_http_data_only'] = True + return self.list_event_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_event_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_event_for_all_namespaces # noqa: E501 + + list or watch objects of kind Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_event_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(EventsV1EventList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_event_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "EventsV1EventList", + 401: None, + } + + return self.api_client.call_api( + '/apis/events.k8s.io/v1/events', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_event(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_event # noqa: E501 + + list or watch objects of kind Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_event(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: EventsV1EventList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_event_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_event_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_event # noqa: E501 + + list or watch objects of kind Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_event_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(EventsV1EventList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_event`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "EventsV1EventList", + 401: None, + } + + return self.api_client.call_api( + '/apis/events.k8s.io/v1/namespaces/{namespace}/events', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_event(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_event # noqa: E501 + + partially update the specified Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_event(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: EventsV1Event + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_event_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_event_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_event # noqa: E501 + + partially update the specified Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_event_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(EventsV1Event, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_event`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_event`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_event`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "EventsV1Event", + 201: "EventsV1Event", + 401: None, + } + + return self.api_client.call_api( + '/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_event(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_event # noqa: E501 + + read the specified Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_event(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: EventsV1Event + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_event_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_event_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_event # noqa: E501 + + read the specified Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_event_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(EventsV1Event, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_event`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_event`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "EventsV1Event", + 401: None, + } + + return self.api_client.call_api( + '/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_event(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_event # noqa: E501 + + replace the specified Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_event(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: EventsV1Event + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: EventsV1Event + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_event_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_event_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_event # noqa: E501 + + replace the specified Event # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_event_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Event (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: EventsV1Event + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(EventsV1Event, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_event" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_event`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_event`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_event`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "EventsV1Event", + 201: "EventsV1Event", + 401: None, + } + + return self.api_client.call_api( + '/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/flowcontrol_apiserver_api.py b/kubernetes_asyncio/client/api/flowcontrol_apiserver_api.py new file mode 100644 index 0000000000..697d249476 --- /dev/null +++ b/kubernetes_asyncio/client/api/flowcontrol_apiserver_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class FlowcontrolApiserverApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/flowcontrol_apiserver_v1_api.py b/kubernetes_asyncio/client/api/flowcontrol_apiserver_v1_api.py new file mode 100644 index 0000000000..95d117a117 --- /dev/null +++ b/kubernetes_asyncio/client/api/flowcontrol_apiserver_v1_api.py @@ -0,0 +1,3809 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class FlowcontrolApiserverV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_flow_schema(self, body, **kwargs): # noqa: E501 + """create_flow_schema # noqa: E501 + + create a FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_flow_schema(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1FlowSchema + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1FlowSchema + """ + kwargs['_return_http_data_only'] = True + return self.create_flow_schema_with_http_info(body, **kwargs) # noqa: E501 + + def create_flow_schema_with_http_info(self, body, **kwargs): # noqa: E501 + """create_flow_schema # noqa: E501 + + create a FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_flow_schema_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1FlowSchema + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1FlowSchema, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_flow_schema" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_flow_schema`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1FlowSchema", + 201: "V1FlowSchema", + 202: "V1FlowSchema", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_priority_level_configuration(self, body, **kwargs): # noqa: E501 + """create_priority_level_configuration # noqa: E501 + + create a PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_priority_level_configuration(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1PriorityLevelConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PriorityLevelConfiguration + """ + kwargs['_return_http_data_only'] = True + return self.create_priority_level_configuration_with_http_info(body, **kwargs) # noqa: E501 + + def create_priority_level_configuration_with_http_info(self, body, **kwargs): # noqa: E501 + """create_priority_level_configuration # noqa: E501 + + create a PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_priority_level_configuration_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1PriorityLevelConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PriorityLevelConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_priority_level_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_priority_level_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PriorityLevelConfiguration", + 201: "V1PriorityLevelConfiguration", + 202: "V1PriorityLevelConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_flow_schema(self, **kwargs): # noqa: E501 + """delete_collection_flow_schema # noqa: E501 + + delete collection of FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_flow_schema(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_flow_schema_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_flow_schema_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_flow_schema # noqa: E501 + + delete collection of FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_flow_schema_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_flow_schema" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_priority_level_configuration(self, **kwargs): # noqa: E501 + """delete_collection_priority_level_configuration # noqa: E501 + + delete collection of PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_priority_level_configuration(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_priority_level_configuration_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_priority_level_configuration_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_priority_level_configuration # noqa: E501 + + delete collection of PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_priority_level_configuration_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_priority_level_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_flow_schema(self, name, **kwargs): # noqa: E501 + """delete_flow_schema # noqa: E501 + + delete a FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_flow_schema(name, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_flow_schema_with_http_info(name, **kwargs) # noqa: E501 + + def delete_flow_schema_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_flow_schema # noqa: E501 + + delete a FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_flow_schema_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_flow_schema" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_flow_schema`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_priority_level_configuration(self, name, **kwargs): # noqa: E501 + """delete_priority_level_configuration # noqa: E501 + + delete a PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_priority_level_configuration(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_priority_level_configuration_with_http_info(name, **kwargs) # noqa: E501 + + def delete_priority_level_configuration_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_priority_level_configuration # noqa: E501 + + delete a PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_priority_level_configuration_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_priority_level_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_priority_level_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_flow_schema(self, **kwargs): # noqa: E501 + """list_flow_schema # noqa: E501 + + list or watch objects of kind FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_flow_schema(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1FlowSchemaList + """ + kwargs['_return_http_data_only'] = True + return self.list_flow_schema_with_http_info(**kwargs) # noqa: E501 + + def list_flow_schema_with_http_info(self, **kwargs): # noqa: E501 + """list_flow_schema # noqa: E501 + + list or watch objects of kind FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_flow_schema_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1FlowSchemaList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_flow_schema" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1FlowSchemaList", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_priority_level_configuration(self, **kwargs): # noqa: E501 + """list_priority_level_configuration # noqa: E501 + + list or watch objects of kind PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_priority_level_configuration(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PriorityLevelConfigurationList + """ + kwargs['_return_http_data_only'] = True + return self.list_priority_level_configuration_with_http_info(**kwargs) # noqa: E501 + + def list_priority_level_configuration_with_http_info(self, **kwargs): # noqa: E501 + """list_priority_level_configuration # noqa: E501 + + list or watch objects of kind PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_priority_level_configuration_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PriorityLevelConfigurationList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_priority_level_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PriorityLevelConfigurationList", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_flow_schema(self, name, body, **kwargs): # noqa: E501 + """patch_flow_schema # noqa: E501 + + partially update the specified FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_flow_schema(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1FlowSchema + """ + kwargs['_return_http_data_only'] = True + return self.patch_flow_schema_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_flow_schema_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_flow_schema # noqa: E501 + + partially update the specified FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_flow_schema_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1FlowSchema, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_flow_schema" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_flow_schema`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_flow_schema`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1FlowSchema", + 201: "V1FlowSchema", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_flow_schema_status(self, name, body, **kwargs): # noqa: E501 + """patch_flow_schema_status # noqa: E501 + + partially update status of the specified FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_flow_schema_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1FlowSchema + """ + kwargs['_return_http_data_only'] = True + return self.patch_flow_schema_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_flow_schema_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_flow_schema_status # noqa: E501 + + partially update status of the specified FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_flow_schema_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1FlowSchema, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_flow_schema_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_flow_schema_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_flow_schema_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1FlowSchema", + 201: "V1FlowSchema", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_priority_level_configuration(self, name, body, **kwargs): # noqa: E501 + """patch_priority_level_configuration # noqa: E501 + + partially update the specified PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_priority_level_configuration(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PriorityLevelConfiguration + """ + kwargs['_return_http_data_only'] = True + return self.patch_priority_level_configuration_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_priority_level_configuration_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_priority_level_configuration # noqa: E501 + + partially update the specified PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_priority_level_configuration_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PriorityLevelConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_priority_level_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_priority_level_configuration`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_priority_level_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PriorityLevelConfiguration", + 201: "V1PriorityLevelConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_priority_level_configuration_status(self, name, body, **kwargs): # noqa: E501 + """patch_priority_level_configuration_status # noqa: E501 + + partially update status of the specified PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_priority_level_configuration_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PriorityLevelConfiguration + """ + kwargs['_return_http_data_only'] = True + return self.patch_priority_level_configuration_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_priority_level_configuration_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_priority_level_configuration_status # noqa: E501 + + partially update status of the specified PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_priority_level_configuration_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PriorityLevelConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_priority_level_configuration_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_priority_level_configuration_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_priority_level_configuration_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PriorityLevelConfiguration", + 201: "V1PriorityLevelConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_flow_schema(self, name, **kwargs): # noqa: E501 + """read_flow_schema # noqa: E501 + + read the specified FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_flow_schema(name, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1FlowSchema + """ + kwargs['_return_http_data_only'] = True + return self.read_flow_schema_with_http_info(name, **kwargs) # noqa: E501 + + def read_flow_schema_with_http_info(self, name, **kwargs): # noqa: E501 + """read_flow_schema # noqa: E501 + + read the specified FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_flow_schema_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1FlowSchema, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_flow_schema" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_flow_schema`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1FlowSchema", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_flow_schema_status(self, name, **kwargs): # noqa: E501 + """read_flow_schema_status # noqa: E501 + + read status of the specified FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_flow_schema_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1FlowSchema + """ + kwargs['_return_http_data_only'] = True + return self.read_flow_schema_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_flow_schema_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_flow_schema_status # noqa: E501 + + read status of the specified FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_flow_schema_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1FlowSchema, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_flow_schema_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_flow_schema_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1FlowSchema", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_priority_level_configuration(self, name, **kwargs): # noqa: E501 + """read_priority_level_configuration # noqa: E501 + + read the specified PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_priority_level_configuration(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PriorityLevelConfiguration + """ + kwargs['_return_http_data_only'] = True + return self.read_priority_level_configuration_with_http_info(name, **kwargs) # noqa: E501 + + def read_priority_level_configuration_with_http_info(self, name, **kwargs): # noqa: E501 + """read_priority_level_configuration # noqa: E501 + + read the specified PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_priority_level_configuration_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PriorityLevelConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_priority_level_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_priority_level_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PriorityLevelConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_priority_level_configuration_status(self, name, **kwargs): # noqa: E501 + """read_priority_level_configuration_status # noqa: E501 + + read status of the specified PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_priority_level_configuration_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PriorityLevelConfiguration + """ + kwargs['_return_http_data_only'] = True + return self.read_priority_level_configuration_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_priority_level_configuration_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_priority_level_configuration_status # noqa: E501 + + read status of the specified PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_priority_level_configuration_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PriorityLevelConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_priority_level_configuration_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_priority_level_configuration_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PriorityLevelConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_flow_schema(self, name, body, **kwargs): # noqa: E501 + """replace_flow_schema # noqa: E501 + + replace the specified FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_flow_schema(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param body: (required) + :type body: V1FlowSchema + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1FlowSchema + """ + kwargs['_return_http_data_only'] = True + return self.replace_flow_schema_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_flow_schema_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_flow_schema # noqa: E501 + + replace the specified FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_flow_schema_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param body: (required) + :type body: V1FlowSchema + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1FlowSchema, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_flow_schema" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_flow_schema`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_flow_schema`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1FlowSchema", + 201: "V1FlowSchema", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_flow_schema_status(self, name, body, **kwargs): # noqa: E501 + """replace_flow_schema_status # noqa: E501 + + replace status of the specified FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_flow_schema_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param body: (required) + :type body: V1FlowSchema + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1FlowSchema + """ + kwargs['_return_http_data_only'] = True + return self.replace_flow_schema_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_flow_schema_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_flow_schema_status # noqa: E501 + + replace status of the specified FlowSchema # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_flow_schema_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the FlowSchema (required) + :type name: str + :param body: (required) + :type body: V1FlowSchema + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1FlowSchema, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_flow_schema_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_flow_schema_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_flow_schema_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1FlowSchema", + 201: "V1FlowSchema", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/flowschemas/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_priority_level_configuration(self, name, body, **kwargs): # noqa: E501 + """replace_priority_level_configuration # noqa: E501 + + replace the specified PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_priority_level_configuration(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param body: (required) + :type body: V1PriorityLevelConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PriorityLevelConfiguration + """ + kwargs['_return_http_data_only'] = True + return self.replace_priority_level_configuration_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_priority_level_configuration_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_priority_level_configuration # noqa: E501 + + replace the specified PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_priority_level_configuration_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param body: (required) + :type body: V1PriorityLevelConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PriorityLevelConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_priority_level_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_priority_level_configuration`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_priority_level_configuration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PriorityLevelConfiguration", + 201: "V1PriorityLevelConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_priority_level_configuration_status(self, name, body, **kwargs): # noqa: E501 + """replace_priority_level_configuration_status # noqa: E501 + + replace status of the specified PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_priority_level_configuration_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param body: (required) + :type body: V1PriorityLevelConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PriorityLevelConfiguration + """ + kwargs['_return_http_data_only'] = True + return self.replace_priority_level_configuration_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_priority_level_configuration_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_priority_level_configuration_status # noqa: E501 + + replace status of the specified PriorityLevelConfiguration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_priority_level_configuration_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityLevelConfiguration (required) + :type name: str + :param body: (required) + :type body: V1PriorityLevelConfiguration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PriorityLevelConfiguration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_priority_level_configuration_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_priority_level_configuration_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_priority_level_configuration_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PriorityLevelConfiguration", + 201: "V1PriorityLevelConfiguration", + 401: None, + } + + return self.api_client.call_api( + '/apis/flowcontrol.apiserver.k8s.io/v1/prioritylevelconfigurations/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/internal_apiserver_api.py b/kubernetes_asyncio/client/api/internal_apiserver_api.py new file mode 100644 index 0000000000..6b7112891b --- /dev/null +++ b/kubernetes_asyncio/client/api/internal_apiserver_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class InternalApiserverApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/internal.apiserver.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/internal_apiserver_v1alpha1_api.py b/kubernetes_asyncio/client/api/internal_apiserver_v1alpha1_api.py new file mode 100644 index 0000000000..303761c96d --- /dev/null +++ b/kubernetes_asyncio/client/api/internal_apiserver_v1alpha1_api.py @@ -0,0 +1,1987 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class InternalApiserverV1alpha1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_storage_version(self, body, **kwargs): # noqa: E501 + """create_storage_version # noqa: E501 + + create a StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_storage_version(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1alpha1StorageVersion + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1StorageVersion + """ + kwargs['_return_http_data_only'] = True + return self.create_storage_version_with_http_info(body, **kwargs) # noqa: E501 + + def create_storage_version_with_http_info(self, body, **kwargs): # noqa: E501 + """create_storage_version # noqa: E501 + + create a StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_storage_version_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1alpha1StorageVersion + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1StorageVersion, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_storage_version" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_storage_version`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1StorageVersion", + 201: "V1alpha1StorageVersion", + 202: "V1alpha1StorageVersion", + 401: None, + } + + return self.api_client.call_api( + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_storage_version(self, **kwargs): # noqa: E501 + """delete_collection_storage_version # noqa: E501 + + delete collection of StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_storage_version(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_storage_version_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_storage_version_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_storage_version # noqa: E501 + + delete collection of StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_storage_version_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_storage_version" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_storage_version(self, name, **kwargs): # noqa: E501 + """delete_storage_version # noqa: E501 + + delete a StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_storage_version(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_storage_version_with_http_info(name, **kwargs) # noqa: E501 + + def delete_storage_version_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_storage_version # noqa: E501 + + delete a StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_storage_version_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_storage_version" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_storage_version`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/internal.apiserver.k8s.io/v1alpha1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_storage_version(self, **kwargs): # noqa: E501 + """list_storage_version # noqa: E501 + + list or watch objects of kind StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_storage_version(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1StorageVersionList + """ + kwargs['_return_http_data_only'] = True + return self.list_storage_version_with_http_info(**kwargs) # noqa: E501 + + def list_storage_version_with_http_info(self, **kwargs): # noqa: E501 + """list_storage_version # noqa: E501 + + list or watch objects of kind StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_storage_version_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1StorageVersionList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_storage_version" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1StorageVersionList", + 401: None, + } + + return self.api_client.call_api( + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_storage_version(self, name, body, **kwargs): # noqa: E501 + """patch_storage_version # noqa: E501 + + partially update the specified StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_storage_version(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1StorageVersion + """ + kwargs['_return_http_data_only'] = True + return self.patch_storage_version_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_storage_version_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_storage_version # noqa: E501 + + partially update the specified StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_storage_version_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1StorageVersion, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_storage_version" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_storage_version`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_storage_version`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1StorageVersion", + 201: "V1alpha1StorageVersion", + 401: None, + } + + return self.api_client.call_api( + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_storage_version_status(self, name, body, **kwargs): # noqa: E501 + """patch_storage_version_status # noqa: E501 + + partially update status of the specified StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_storage_version_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1StorageVersion + """ + kwargs['_return_http_data_only'] = True + return self.patch_storage_version_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_storage_version_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_storage_version_status # noqa: E501 + + partially update status of the specified StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_storage_version_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1StorageVersion, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_storage_version_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_storage_version_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_storage_version_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1StorageVersion", + 201: "V1alpha1StorageVersion", + 401: None, + } + + return self.api_client.call_api( + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_storage_version(self, name, **kwargs): # noqa: E501 + """read_storage_version # noqa: E501 + + read the specified StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_storage_version(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1StorageVersion + """ + kwargs['_return_http_data_only'] = True + return self.read_storage_version_with_http_info(name, **kwargs) # noqa: E501 + + def read_storage_version_with_http_info(self, name, **kwargs): # noqa: E501 + """read_storage_version # noqa: E501 + + read the specified StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_storage_version_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1StorageVersion, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_storage_version" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_storage_version`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1StorageVersion", + 401: None, + } + + return self.api_client.call_api( + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_storage_version_status(self, name, **kwargs): # noqa: E501 + """read_storage_version_status # noqa: E501 + + read status of the specified StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_storage_version_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1StorageVersion + """ + kwargs['_return_http_data_only'] = True + return self.read_storage_version_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_storage_version_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_storage_version_status # noqa: E501 + + read status of the specified StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_storage_version_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1StorageVersion, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_storage_version_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_storage_version_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1StorageVersion", + 401: None, + } + + return self.api_client.call_api( + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_storage_version(self, name, body, **kwargs): # noqa: E501 + """replace_storage_version # noqa: E501 + + replace the specified StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_storage_version(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param body: (required) + :type body: V1alpha1StorageVersion + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1StorageVersion + """ + kwargs['_return_http_data_only'] = True + return self.replace_storage_version_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_storage_version_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_storage_version # noqa: E501 + + replace the specified StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_storage_version_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param body: (required) + :type body: V1alpha1StorageVersion + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1StorageVersion, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_storage_version" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_storage_version`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_storage_version`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1StorageVersion", + 201: "V1alpha1StorageVersion", + 401: None, + } + + return self.api_client.call_api( + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_storage_version_status(self, name, body, **kwargs): # noqa: E501 + """replace_storage_version_status # noqa: E501 + + replace status of the specified StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_storage_version_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param body: (required) + :type body: V1alpha1StorageVersion + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1StorageVersion + """ + kwargs['_return_http_data_only'] = True + return self.replace_storage_version_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_storage_version_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_storage_version_status # noqa: E501 + + replace status of the specified StorageVersion # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_storage_version_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersion (required) + :type name: str + :param body: (required) + :type body: V1alpha1StorageVersion + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1StorageVersion, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_storage_version_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_storage_version_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_storage_version_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1StorageVersion", + 201: "V1alpha1StorageVersion", + 401: None, + } + + return self.api_client.call_api( + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/logs_api.py b/kubernetes_asyncio/client/api/logs_api.py new file mode 100644 index 0000000000..4aac1fcef3 --- /dev/null +++ b/kubernetes_asyncio/client/api/logs_api.py @@ -0,0 +1,285 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class LogsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def log_file_handler(self, logpath, **kwargs): # noqa: E501 + """log_file_handler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.log_file_handler(logpath, async_req=True) + >>> result = thread.get() + + :param logpath: path to the log (required) + :type logpath: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + return self.log_file_handler_with_http_info(logpath, **kwargs) # noqa: E501 + + def log_file_handler_with_http_info(self, logpath, **kwargs): # noqa: E501 + """log_file_handler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.log_file_handler_with_http_info(logpath, async_req=True) + >>> result = thread.get() + + :param logpath: path to the log (required) + :type logpath: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + local_var_params = locals() + + all_params = [ + 'logpath' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method log_file_handler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'logpath' is set + if self.api_client.client_side_validation and local_var_params.get('logpath') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `logpath` when calling `log_file_handler`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'logpath' in local_var_params: + path_params['logpath'] = local_var_params['logpath'] # noqa: E501 + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + '/logs/{logpath}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def log_file_list_handler(self, **kwargs): # noqa: E501 + """log_file_list_handler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.log_file_list_handler(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + kwargs['_return_http_data_only'] = True + return self.log_file_list_handler_with_http_info(**kwargs) # noqa: E501 + + def log_file_list_handler_with_http_info(self, **kwargs): # noqa: E501 + """log_file_list_handler # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.log_file_list_handler_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: None + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method log_file_list_handler" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = {} + + return self.api_client.call_api( + '/logs/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/networking_api.py b/kubernetes_asyncio/client/api/networking_api.py new file mode 100644 index 0000000000..3f8a6241ba --- /dev/null +++ b/kubernetes_asyncio/client/api/networking_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class NetworkingApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/networking_v1_api.py b/kubernetes_asyncio/client/api/networking_v1_api.py new file mode 100644 index 0000000000..2471785de5 --- /dev/null +++ b/kubernetes_asyncio/client/api/networking_v1_api.py @@ -0,0 +1,8313 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class NetworkingV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_ingress_class(self, body, **kwargs): # noqa: E501 + """create_ingress_class # noqa: E501 + + create an IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_ingress_class(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1IngressClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1IngressClass + """ + kwargs['_return_http_data_only'] = True + return self.create_ingress_class_with_http_info(body, **kwargs) # noqa: E501 + + def create_ingress_class_with_http_info(self, body, **kwargs): # noqa: E501 + """create_ingress_class # noqa: E501 + + create an IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_ingress_class_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1IngressClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1IngressClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_ingress_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_ingress_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1IngressClass", + 201: "V1IngressClass", + 202: "V1IngressClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ingressclasses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_ip_address(self, body, **kwargs): # noqa: E501 + """create_ip_address # noqa: E501 + + create an IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_ip_address(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1IPAddress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1IPAddress + """ + kwargs['_return_http_data_only'] = True + return self.create_ip_address_with_http_info(body, **kwargs) # noqa: E501 + + def create_ip_address_with_http_info(self, body, **kwargs): # noqa: E501 + """create_ip_address # noqa: E501 + + create an IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_ip_address_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1IPAddress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1IPAddress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_ip_address`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1IPAddress", + 201: "V1IPAddress", + 202: "V1IPAddress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ipaddresses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_ingress(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_ingress # noqa: E501 + + create an Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_ingress(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Ingress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Ingress + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_ingress_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_ingress_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_ingress # noqa: E501 + + create an Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_ingress_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Ingress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Ingress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_ingress" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_ingress`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_ingress`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Ingress", + 201: "V1Ingress", + 202: "V1Ingress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_network_policy(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_network_policy # noqa: E501 + + create a NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_network_policy(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1NetworkPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1NetworkPolicy + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_network_policy_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_network_policy_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_network_policy # noqa: E501 + + create a NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_network_policy_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1NetworkPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1NetworkPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_network_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_network_policy`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_network_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1NetworkPolicy", + 201: "V1NetworkPolicy", + 202: "V1NetworkPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_service_cidr(self, body, **kwargs): # noqa: E501 + """create_service_cidr # noqa: E501 + + create a ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_service_cidr(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ServiceCIDR + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.create_service_cidr_with_http_info(body, **kwargs) # noqa: E501 + + def create_service_cidr_with_http_info(self, body, **kwargs): # noqa: E501 + """create_service_cidr # noqa: E501 + + create a ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_service_cidr_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ServiceCIDR + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_service_cidr`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceCIDR", + 201: "V1ServiceCIDR", + 202: "V1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/servicecidrs', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_ingress_class(self, **kwargs): # noqa: E501 + """delete_collection_ingress_class # noqa: E501 + + delete collection of IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_ingress_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_ingress_class_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_ingress_class_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_ingress_class # noqa: E501 + + delete collection of IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_ingress_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_ingress_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ingressclasses', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_ip_address(self, **kwargs): # noqa: E501 + """delete_collection_ip_address # noqa: E501 + + delete collection of IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_ip_address(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_ip_address_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_ip_address_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_ip_address # noqa: E501 + + delete collection of IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_ip_address_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ipaddresses', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_ingress(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_ingress # noqa: E501 + + delete collection of Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_ingress(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_ingress_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_ingress_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_ingress # noqa: E501 + + delete collection of Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_ingress_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_ingress" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_ingress`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_network_policy(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_network_policy # noqa: E501 + + delete collection of NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_network_policy(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_network_policy_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_network_policy_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_network_policy # noqa: E501 + + delete collection of NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_network_policy_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_network_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_network_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_service_cidr(self, **kwargs): # noqa: E501 + """delete_collection_service_cidr # noqa: E501 + + delete collection of ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_service_cidr(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_service_cidr_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_service_cidr_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_service_cidr # noqa: E501 + + delete collection of ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_service_cidr_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/servicecidrs', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_ingress_class(self, name, **kwargs): # noqa: E501 + """delete_ingress_class # noqa: E501 + + delete an IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_ingress_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the IngressClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_ingress_class_with_http_info(name, **kwargs) # noqa: E501 + + def delete_ingress_class_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_ingress_class # noqa: E501 + + delete an IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_ingress_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the IngressClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_ingress_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_ingress_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ingressclasses/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_ip_address(self, name, **kwargs): # noqa: E501 + """delete_ip_address # noqa: E501 + + delete an IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_ip_address(name, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_ip_address_with_http_info(name, **kwargs) # noqa: E501 + + def delete_ip_address_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_ip_address # noqa: E501 + + delete an IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_ip_address_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_ip_address`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ipaddresses/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_ingress(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_ingress # noqa: E501 + + delete an Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_ingress(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_ingress_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_ingress_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_ingress # noqa: E501 + + delete an Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_ingress_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_ingress" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_ingress`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_ingress`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_network_policy(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_network_policy # noqa: E501 + + delete a NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_network_policy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the NetworkPolicy (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_network_policy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_network_policy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_network_policy # noqa: E501 + + delete a NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_network_policy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the NetworkPolicy (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_network_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_network_policy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_network_policy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_service_cidr(self, name, **kwargs): # noqa: E501 + """delete_service_cidr # noqa: E501 + + delete a ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_service_cidr(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_service_cidr_with_http_info(name, **kwargs) # noqa: E501 + + def delete_service_cidr_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_service_cidr # noqa: E501 + + delete a ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_service_cidr_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_service_cidr`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/servicecidrs/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_ingress_class(self, **kwargs): # noqa: E501 + """list_ingress_class # noqa: E501 + + list or watch objects of kind IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_ingress_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1IngressClassList + """ + kwargs['_return_http_data_only'] = True + return self.list_ingress_class_with_http_info(**kwargs) # noqa: E501 + + def list_ingress_class_with_http_info(self, **kwargs): # noqa: E501 + """list_ingress_class # noqa: E501 + + list or watch objects of kind IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_ingress_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1IngressClassList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_ingress_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1IngressClassList", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ingressclasses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_ingress_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_ingress_for_all_namespaces # noqa: E501 + + list or watch objects of kind Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_ingress_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1IngressList + """ + kwargs['_return_http_data_only'] = True + return self.list_ingress_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_ingress_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_ingress_for_all_namespaces # noqa: E501 + + list or watch objects of kind Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_ingress_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1IngressList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_ingress_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1IngressList", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ingresses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_ip_address(self, **kwargs): # noqa: E501 + """list_ip_address # noqa: E501 + + list or watch objects of kind IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_ip_address(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1IPAddressList + """ + kwargs['_return_http_data_only'] = True + return self.list_ip_address_with_http_info(**kwargs) # noqa: E501 + + def list_ip_address_with_http_info(self, **kwargs): # noqa: E501 + """list_ip_address # noqa: E501 + + list or watch objects of kind IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_ip_address_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1IPAddressList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1IPAddressList", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ipaddresses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_ingress(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_ingress # noqa: E501 + + list or watch objects of kind Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_ingress(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1IngressList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_ingress_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_ingress_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_ingress # noqa: E501 + + list or watch objects of kind Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_ingress_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1IngressList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_ingress" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_ingress`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1IngressList", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_network_policy(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_network_policy # noqa: E501 + + list or watch objects of kind NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_network_policy(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1NetworkPolicyList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_network_policy_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_network_policy_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_network_policy # noqa: E501 + + list or watch objects of kind NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_network_policy_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1NetworkPolicyList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_network_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_network_policy`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1NetworkPolicyList", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_network_policy_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_network_policy_for_all_namespaces # noqa: E501 + + list or watch objects of kind NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_network_policy_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1NetworkPolicyList + """ + kwargs['_return_http_data_only'] = True + return self.list_network_policy_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_network_policy_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_network_policy_for_all_namespaces # noqa: E501 + + list or watch objects of kind NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_network_policy_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1NetworkPolicyList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_network_policy_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1NetworkPolicyList", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/networkpolicies', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_service_cidr(self, **kwargs): # noqa: E501 + """list_service_cidr # noqa: E501 + + list or watch objects of kind ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_service_cidr(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceCIDRList + """ + kwargs['_return_http_data_only'] = True + return self.list_service_cidr_with_http_info(**kwargs) # noqa: E501 + + def list_service_cidr_with_http_info(self, **kwargs): # noqa: E501 + """list_service_cidr # noqa: E501 + + list or watch objects of kind ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_service_cidr_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceCIDRList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceCIDRList", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/servicecidrs', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_ingress_class(self, name, body, **kwargs): # noqa: E501 + """patch_ingress_class # noqa: E501 + + partially update the specified IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_ingress_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the IngressClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1IngressClass + """ + kwargs['_return_http_data_only'] = True + return self.patch_ingress_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_ingress_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_ingress_class # noqa: E501 + + partially update the specified IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_ingress_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the IngressClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1IngressClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_ingress_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_ingress_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_ingress_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1IngressClass", + 201: "V1IngressClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ingressclasses/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_ip_address(self, name, body, **kwargs): # noqa: E501 + """patch_ip_address # noqa: E501 + + partially update the specified IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_ip_address(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1IPAddress + """ + kwargs['_return_http_data_only'] = True + return self.patch_ip_address_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_ip_address_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_ip_address # noqa: E501 + + partially update the specified IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_ip_address_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1IPAddress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_ip_address`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_ip_address`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1IPAddress", + 201: "V1IPAddress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ipaddresses/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_ingress(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_ingress # noqa: E501 + + partially update the specified Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_ingress(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Ingress + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_ingress_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_ingress_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_ingress # noqa: E501 + + partially update the specified Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_ingress_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Ingress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_ingress" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_ingress`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_ingress`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_ingress`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Ingress", + 201: "V1Ingress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_ingress_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_ingress_status # noqa: E501 + + partially update status of the specified Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_ingress_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Ingress + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_ingress_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_ingress_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_ingress_status # noqa: E501 + + partially update status of the specified Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_ingress_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Ingress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_ingress_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_ingress_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_ingress_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_ingress_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Ingress", + 201: "V1Ingress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_network_policy(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_network_policy # noqa: E501 + + partially update the specified NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_network_policy(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the NetworkPolicy (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1NetworkPolicy + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_network_policy_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_network_policy_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_network_policy # noqa: E501 + + partially update the specified NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_network_policy_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the NetworkPolicy (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1NetworkPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_network_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_network_policy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_network_policy`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_network_policy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1NetworkPolicy", + 201: "V1NetworkPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_service_cidr(self, name, body, **kwargs): # noqa: E501 + """patch_service_cidr # noqa: E501 + + partially update the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_service_cidr(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.patch_service_cidr_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_service_cidr_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_service_cidr # noqa: E501 + + partially update the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_service_cidr_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_service_cidr`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_service_cidr`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceCIDR", + 201: "V1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/servicecidrs/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_service_cidr_status(self, name, body, **kwargs): # noqa: E501 + """patch_service_cidr_status # noqa: E501 + + partially update status of the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_service_cidr_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.patch_service_cidr_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_service_cidr_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_service_cidr_status # noqa: E501 + + partially update status of the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_service_cidr_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_service_cidr_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_service_cidr_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_service_cidr_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceCIDR", + 201: "V1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/servicecidrs/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_ingress_class(self, name, **kwargs): # noqa: E501 + """read_ingress_class # noqa: E501 + + read the specified IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_ingress_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the IngressClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1IngressClass + """ + kwargs['_return_http_data_only'] = True + return self.read_ingress_class_with_http_info(name, **kwargs) # noqa: E501 + + def read_ingress_class_with_http_info(self, name, **kwargs): # noqa: E501 + """read_ingress_class # noqa: E501 + + read the specified IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_ingress_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the IngressClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1IngressClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_ingress_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_ingress_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1IngressClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ingressclasses/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_ip_address(self, name, **kwargs): # noqa: E501 + """read_ip_address # noqa: E501 + + read the specified IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_ip_address(name, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1IPAddress + """ + kwargs['_return_http_data_only'] = True + return self.read_ip_address_with_http_info(name, **kwargs) # noqa: E501 + + def read_ip_address_with_http_info(self, name, **kwargs): # noqa: E501 + """read_ip_address # noqa: E501 + + read the specified IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_ip_address_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1IPAddress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_ip_address`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1IPAddress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ipaddresses/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_ingress(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_ingress # noqa: E501 + + read the specified Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_ingress(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Ingress + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_ingress_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_ingress_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_ingress # noqa: E501 + + read the specified Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_ingress_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Ingress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_ingress" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_ingress`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_ingress`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Ingress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_ingress_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_ingress_status # noqa: E501 + + read status of the specified Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_ingress_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Ingress + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_ingress_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_ingress_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_ingress_status # noqa: E501 + + read status of the specified Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_ingress_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Ingress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_ingress_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_ingress_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_ingress_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Ingress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_network_policy(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_network_policy # noqa: E501 + + read the specified NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_network_policy(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the NetworkPolicy (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1NetworkPolicy + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_network_policy_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_network_policy_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_network_policy # noqa: E501 + + read the specified NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_network_policy_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the NetworkPolicy (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1NetworkPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_network_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_network_policy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_network_policy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1NetworkPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_service_cidr(self, name, **kwargs): # noqa: E501 + """read_service_cidr # noqa: E501 + + read the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_service_cidr(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.read_service_cidr_with_http_info(name, **kwargs) # noqa: E501 + + def read_service_cidr_with_http_info(self, name, **kwargs): # noqa: E501 + """read_service_cidr # noqa: E501 + + read the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_service_cidr_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_service_cidr`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/servicecidrs/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_service_cidr_status(self, name, **kwargs): # noqa: E501 + """read_service_cidr_status # noqa: E501 + + read status of the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_service_cidr_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.read_service_cidr_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_service_cidr_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_service_cidr_status # noqa: E501 + + read status of the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_service_cidr_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_service_cidr_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_service_cidr_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/servicecidrs/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_ingress_class(self, name, body, **kwargs): # noqa: E501 + """replace_ingress_class # noqa: E501 + + replace the specified IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_ingress_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the IngressClass (required) + :type name: str + :param body: (required) + :type body: V1IngressClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1IngressClass + """ + kwargs['_return_http_data_only'] = True + return self.replace_ingress_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_ingress_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_ingress_class # noqa: E501 + + replace the specified IngressClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_ingress_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the IngressClass (required) + :type name: str + :param body: (required) + :type body: V1IngressClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1IngressClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_ingress_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_ingress_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_ingress_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1IngressClass", + 201: "V1IngressClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ingressclasses/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_ip_address(self, name, body, **kwargs): # noqa: E501 + """replace_ip_address # noqa: E501 + + replace the specified IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_ip_address(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param body: (required) + :type body: V1IPAddress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1IPAddress + """ + kwargs['_return_http_data_only'] = True + return self.replace_ip_address_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_ip_address_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_ip_address # noqa: E501 + + replace the specified IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_ip_address_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param body: (required) + :type body: V1IPAddress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1IPAddress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_ip_address`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_ip_address`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1IPAddress", + 201: "V1IPAddress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/ipaddresses/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_ingress(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_ingress # noqa: E501 + + replace the specified Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_ingress(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Ingress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Ingress + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_ingress_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_ingress_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_ingress # noqa: E501 + + replace the specified Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_ingress_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Ingress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Ingress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_ingress" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_ingress`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_ingress`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_ingress`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Ingress", + 201: "V1Ingress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_ingress_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_ingress_status # noqa: E501 + + replace status of the specified Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_ingress_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Ingress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Ingress + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_ingress_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_ingress_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_ingress_status # noqa: E501 + + replace status of the specified Ingress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_ingress_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Ingress (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Ingress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Ingress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_ingress_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_ingress_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_ingress_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_ingress_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Ingress", + 201: "V1Ingress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_network_policy(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_network_policy # noqa: E501 + + replace the specified NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_network_policy(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the NetworkPolicy (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1NetworkPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1NetworkPolicy + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_network_policy_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_network_policy_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_network_policy # noqa: E501 + + replace the specified NetworkPolicy # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_network_policy_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the NetworkPolicy (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1NetworkPolicy + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1NetworkPolicy, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_network_policy" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_network_policy`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_network_policy`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_network_policy`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1NetworkPolicy", + 201: "V1NetworkPolicy", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_service_cidr(self, name, body, **kwargs): # noqa: E501 + """replace_service_cidr # noqa: E501 + + replace the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_service_cidr(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: V1ServiceCIDR + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.replace_service_cidr_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_service_cidr_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_service_cidr # noqa: E501 + + replace the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_service_cidr_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: V1ServiceCIDR + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_service_cidr`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_service_cidr`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceCIDR", + 201: "V1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/servicecidrs/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_service_cidr_status(self, name, body, **kwargs): # noqa: E501 + """replace_service_cidr_status # noqa: E501 + + replace status of the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_service_cidr_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: V1ServiceCIDR + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.replace_service_cidr_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_service_cidr_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_service_cidr_status # noqa: E501 + + replace status of the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_service_cidr_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: V1ServiceCIDR + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_service_cidr_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_service_cidr_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_service_cidr_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ServiceCIDR", + 201: "V1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1/servicecidrs/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/networking_v1beta1_api.py b/kubernetes_asyncio/client/api/networking_v1beta1_api.py new file mode 100644 index 0000000000..e983454557 --- /dev/null +++ b/kubernetes_asyncio/client/api/networking_v1beta1_api.py @@ -0,0 +1,3295 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class NetworkingV1beta1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_ip_address(self, body, **kwargs): # noqa: E501 + """create_ip_address # noqa: E501 + + create an IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_ip_address(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1IPAddress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1IPAddress + """ + kwargs['_return_http_data_only'] = True + return self.create_ip_address_with_http_info(body, **kwargs) # noqa: E501 + + def create_ip_address_with_http_info(self, body, **kwargs): # noqa: E501 + """create_ip_address # noqa: E501 + + create an IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_ip_address_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1IPAddress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1IPAddress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_ip_address`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1IPAddress", + 201: "V1beta1IPAddress", + 202: "V1beta1IPAddress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/ipaddresses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_service_cidr(self, body, **kwargs): # noqa: E501 + """create_service_cidr # noqa: E501 + + create a ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_service_cidr(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1ServiceCIDR + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.create_service_cidr_with_http_info(body, **kwargs) # noqa: E501 + + def create_service_cidr_with_http_info(self, body, **kwargs): # noqa: E501 + """create_service_cidr # noqa: E501 + + create a ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_service_cidr_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1ServiceCIDR + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_service_cidr`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ServiceCIDR", + 201: "V1beta1ServiceCIDR", + 202: "V1beta1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/servicecidrs', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_ip_address(self, **kwargs): # noqa: E501 + """delete_collection_ip_address # noqa: E501 + + delete collection of IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_ip_address(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_ip_address_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_ip_address_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_ip_address # noqa: E501 + + delete collection of IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_ip_address_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/ipaddresses', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_service_cidr(self, **kwargs): # noqa: E501 + """delete_collection_service_cidr # noqa: E501 + + delete collection of ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_service_cidr(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_service_cidr_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_service_cidr_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_service_cidr # noqa: E501 + + delete collection of ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_service_cidr_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/servicecidrs', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_ip_address(self, name, **kwargs): # noqa: E501 + """delete_ip_address # noqa: E501 + + delete an IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_ip_address(name, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_ip_address_with_http_info(name, **kwargs) # noqa: E501 + + def delete_ip_address_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_ip_address # noqa: E501 + + delete an IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_ip_address_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_ip_address`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/ipaddresses/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_service_cidr(self, name, **kwargs): # noqa: E501 + """delete_service_cidr # noqa: E501 + + delete a ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_service_cidr(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_service_cidr_with_http_info(name, **kwargs) # noqa: E501 + + def delete_service_cidr_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_service_cidr # noqa: E501 + + delete a ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_service_cidr_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_service_cidr`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/servicecidrs/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_ip_address(self, **kwargs): # noqa: E501 + """list_ip_address # noqa: E501 + + list or watch objects of kind IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_ip_address(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1IPAddressList + """ + kwargs['_return_http_data_only'] = True + return self.list_ip_address_with_http_info(**kwargs) # noqa: E501 + + def list_ip_address_with_http_info(self, **kwargs): # noqa: E501 + """list_ip_address # noqa: E501 + + list or watch objects of kind IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_ip_address_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1IPAddressList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1IPAddressList", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/ipaddresses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_service_cidr(self, **kwargs): # noqa: E501 + """list_service_cidr # noqa: E501 + + list or watch objects of kind ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_service_cidr(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ServiceCIDRList + """ + kwargs['_return_http_data_only'] = True + return self.list_service_cidr_with_http_info(**kwargs) # noqa: E501 + + def list_service_cidr_with_http_info(self, **kwargs): # noqa: E501 + """list_service_cidr # noqa: E501 + + list or watch objects of kind ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_service_cidr_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ServiceCIDRList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ServiceCIDRList", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/servicecidrs', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_ip_address(self, name, body, **kwargs): # noqa: E501 + """patch_ip_address # noqa: E501 + + partially update the specified IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_ip_address(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1IPAddress + """ + kwargs['_return_http_data_only'] = True + return self.patch_ip_address_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_ip_address_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_ip_address # noqa: E501 + + partially update the specified IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_ip_address_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1IPAddress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_ip_address`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_ip_address`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1IPAddress", + 201: "V1beta1IPAddress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/ipaddresses/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_service_cidr(self, name, body, **kwargs): # noqa: E501 + """patch_service_cidr # noqa: E501 + + partially update the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_service_cidr(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.patch_service_cidr_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_service_cidr_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_service_cidr # noqa: E501 + + partially update the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_service_cidr_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_service_cidr`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_service_cidr`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ServiceCIDR", + 201: "V1beta1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/servicecidrs/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_service_cidr_status(self, name, body, **kwargs): # noqa: E501 + """patch_service_cidr_status # noqa: E501 + + partially update status of the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_service_cidr_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.patch_service_cidr_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_service_cidr_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_service_cidr_status # noqa: E501 + + partially update status of the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_service_cidr_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_service_cidr_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_service_cidr_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_service_cidr_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ServiceCIDR", + 201: "V1beta1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_ip_address(self, name, **kwargs): # noqa: E501 + """read_ip_address # noqa: E501 + + read the specified IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_ip_address(name, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1IPAddress + """ + kwargs['_return_http_data_only'] = True + return self.read_ip_address_with_http_info(name, **kwargs) # noqa: E501 + + def read_ip_address_with_http_info(self, name, **kwargs): # noqa: E501 + """read_ip_address # noqa: E501 + + read the specified IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_ip_address_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1IPAddress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_ip_address`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1IPAddress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/ipaddresses/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_service_cidr(self, name, **kwargs): # noqa: E501 + """read_service_cidr # noqa: E501 + + read the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_service_cidr(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.read_service_cidr_with_http_info(name, **kwargs) # noqa: E501 + + def read_service_cidr_with_http_info(self, name, **kwargs): # noqa: E501 + """read_service_cidr # noqa: E501 + + read the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_service_cidr_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_service_cidr`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/servicecidrs/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_service_cidr_status(self, name, **kwargs): # noqa: E501 + """read_service_cidr_status # noqa: E501 + + read status of the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_service_cidr_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.read_service_cidr_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_service_cidr_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_service_cidr_status # noqa: E501 + + read status of the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_service_cidr_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_service_cidr_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_service_cidr_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_ip_address(self, name, body, **kwargs): # noqa: E501 + """replace_ip_address # noqa: E501 + + replace the specified IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_ip_address(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param body: (required) + :type body: V1beta1IPAddress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1IPAddress + """ + kwargs['_return_http_data_only'] = True + return self.replace_ip_address_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_ip_address_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_ip_address # noqa: E501 + + replace the specified IPAddress # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_ip_address_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the IPAddress (required) + :type name: str + :param body: (required) + :type body: V1beta1IPAddress + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1IPAddress, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_ip_address" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_ip_address`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_ip_address`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1IPAddress", + 201: "V1beta1IPAddress", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/ipaddresses/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_service_cidr(self, name, body, **kwargs): # noqa: E501 + """replace_service_cidr # noqa: E501 + + replace the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_service_cidr(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: V1beta1ServiceCIDR + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.replace_service_cidr_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_service_cidr_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_service_cidr # noqa: E501 + + replace the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_service_cidr_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: V1beta1ServiceCIDR + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_service_cidr" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_service_cidr`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_service_cidr`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ServiceCIDR", + 201: "V1beta1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/servicecidrs/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_service_cidr_status(self, name, body, **kwargs): # noqa: E501 + """replace_service_cidr_status # noqa: E501 + + replace status of the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_service_cidr_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: V1beta1ServiceCIDR + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ServiceCIDR + """ + kwargs['_return_http_data_only'] = True + return self.replace_service_cidr_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_service_cidr_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_service_cidr_status # noqa: E501 + + replace status of the specified ServiceCIDR # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_service_cidr_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ServiceCIDR (required) + :type name: str + :param body: (required) + :type body: V1beta1ServiceCIDR + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ServiceCIDR, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_service_cidr_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_service_cidr_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_service_cidr_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ServiceCIDR", + 201: "V1beta1ServiceCIDR", + 401: None, + } + + return self.api_client.call_api( + '/apis/networking.k8s.io/v1beta1/servicecidrs/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/node_api.py b/kubernetes_asyncio/client/api/node_api.py new file mode 100644 index 0000000000..8154a0f0ee --- /dev/null +++ b/kubernetes_asyncio/client/api/node_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class NodeApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/node.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/node_v1_api.py b/kubernetes_asyncio/client/api/node_v1_api.py new file mode 100644 index 0000000000..923752e2e0 --- /dev/null +++ b/kubernetes_asyncio/client/api/node_v1_api.py @@ -0,0 +1,1473 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class NodeV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_runtime_class(self, body, **kwargs): # noqa: E501 + """create_runtime_class # noqa: E501 + + create a RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_runtime_class(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1RuntimeClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1RuntimeClass + """ + kwargs['_return_http_data_only'] = True + return self.create_runtime_class_with_http_info(body, **kwargs) # noqa: E501 + + def create_runtime_class_with_http_info(self, body, **kwargs): # noqa: E501 + """create_runtime_class # noqa: E501 + + create a RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_runtime_class_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1RuntimeClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1RuntimeClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_runtime_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_runtime_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1RuntimeClass", + 201: "V1RuntimeClass", + 202: "V1RuntimeClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/node.k8s.io/v1/runtimeclasses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_runtime_class(self, **kwargs): # noqa: E501 + """delete_collection_runtime_class # noqa: E501 + + delete collection of RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_runtime_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_runtime_class_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_runtime_class_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_runtime_class # noqa: E501 + + delete collection of RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_runtime_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_runtime_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/node.k8s.io/v1/runtimeclasses', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_runtime_class(self, name, **kwargs): # noqa: E501 + """delete_runtime_class # noqa: E501 + + delete a RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_runtime_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the RuntimeClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_runtime_class_with_http_info(name, **kwargs) # noqa: E501 + + def delete_runtime_class_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_runtime_class # noqa: E501 + + delete a RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_runtime_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the RuntimeClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_runtime_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_runtime_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/node.k8s.io/v1/runtimeclasses/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/node.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_runtime_class(self, **kwargs): # noqa: E501 + """list_runtime_class # noqa: E501 + + list or watch objects of kind RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_runtime_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1RuntimeClassList + """ + kwargs['_return_http_data_only'] = True + return self.list_runtime_class_with_http_info(**kwargs) # noqa: E501 + + def list_runtime_class_with_http_info(self, **kwargs): # noqa: E501 + """list_runtime_class # noqa: E501 + + list or watch objects of kind RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_runtime_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1RuntimeClassList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_runtime_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1RuntimeClassList", + 401: None, + } + + return self.api_client.call_api( + '/apis/node.k8s.io/v1/runtimeclasses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_runtime_class(self, name, body, **kwargs): # noqa: E501 + """patch_runtime_class # noqa: E501 + + partially update the specified RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_runtime_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the RuntimeClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1RuntimeClass + """ + kwargs['_return_http_data_only'] = True + return self.patch_runtime_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_runtime_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_runtime_class # noqa: E501 + + partially update the specified RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_runtime_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the RuntimeClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1RuntimeClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_runtime_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_runtime_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_runtime_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1RuntimeClass", + 201: "V1RuntimeClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/node.k8s.io/v1/runtimeclasses/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_runtime_class(self, name, **kwargs): # noqa: E501 + """read_runtime_class # noqa: E501 + + read the specified RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_runtime_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the RuntimeClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1RuntimeClass + """ + kwargs['_return_http_data_only'] = True + return self.read_runtime_class_with_http_info(name, **kwargs) # noqa: E501 + + def read_runtime_class_with_http_info(self, name, **kwargs): # noqa: E501 + """read_runtime_class # noqa: E501 + + read the specified RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_runtime_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the RuntimeClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1RuntimeClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_runtime_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_runtime_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1RuntimeClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/node.k8s.io/v1/runtimeclasses/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_runtime_class(self, name, body, **kwargs): # noqa: E501 + """replace_runtime_class # noqa: E501 + + replace the specified RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_runtime_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the RuntimeClass (required) + :type name: str + :param body: (required) + :type body: V1RuntimeClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1RuntimeClass + """ + kwargs['_return_http_data_only'] = True + return self.replace_runtime_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_runtime_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_runtime_class # noqa: E501 + + replace the specified RuntimeClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_runtime_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the RuntimeClass (required) + :type name: str + :param body: (required) + :type body: V1RuntimeClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1RuntimeClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_runtime_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_runtime_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_runtime_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1RuntimeClass", + 201: "V1RuntimeClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/node.k8s.io/v1/runtimeclasses/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/openid_api.py b/kubernetes_asyncio/client/api/openid_api.py new file mode 100644 index 0000000000..0a75c25bbf --- /dev/null +++ b/kubernetes_asyncio/client/api/openid_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class OpenidApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_service_account_issuer_open_id_keyset(self, **kwargs): # noqa: E501 + """get_service_account_issuer_open_id_keyset # noqa: E501 + + get service account issuer OpenID JSON Web Key Set (contains public token verification keys) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_service_account_issuer_open_id_keyset(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.get_service_account_issuer_open_id_keyset_with_http_info(**kwargs) # noqa: E501 + + def get_service_account_issuer_open_id_keyset_with_http_info(self, **kwargs): # noqa: E501 + """get_service_account_issuer_open_id_keyset # noqa: E501 + + get service account issuer OpenID JSON Web Key Set (contains public token verification keys) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_service_account_issuer_open_id_keyset_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_service_account_issuer_open_id_keyset" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/jwk-set+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/openid/v1/jwks', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/policy_api.py b/kubernetes_asyncio/client/api/policy_api.py new file mode 100644 index 0000000000..52c0407c6e --- /dev/null +++ b/kubernetes_asyncio/client/api/policy_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class PolicyApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/policy/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/policy_v1_api.py b/kubernetes_asyncio/client/api/policy_v1_api.py new file mode 100644 index 0000000000..dd778f3601 --- /dev/null +++ b/kubernetes_asyncio/client/api/policy_v1_api.py @@ -0,0 +1,2292 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class PolicyV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_namespaced_pod_disruption_budget(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_pod_disruption_budget # noqa: E501 + + create a PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_pod_disruption_budget(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PodDisruptionBudget + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodDisruptionBudget + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_pod_disruption_budget_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_pod_disruption_budget_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_pod_disruption_budget # noqa: E501 + + create a PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_pod_disruption_budget_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PodDisruptionBudget + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodDisruptionBudget, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_pod_disruption_budget" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_pod_disruption_budget`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_pod_disruption_budget`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodDisruptionBudget", + 201: "V1PodDisruptionBudget", + 202: "V1PodDisruptionBudget", + 401: None, + } + + return self.api_client.call_api( + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_pod_disruption_budget(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_pod_disruption_budget # noqa: E501 + + delete collection of PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_pod_disruption_budget(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_pod_disruption_budget_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_pod_disruption_budget_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_pod_disruption_budget # noqa: E501 + + delete collection of PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_pod_disruption_budget_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_pod_disruption_budget" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_pod_disruption_budget`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_pod_disruption_budget(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_pod_disruption_budget # noqa: E501 + + delete a PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_pod_disruption_budget(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_pod_disruption_budget_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_pod_disruption_budget_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_pod_disruption_budget # noqa: E501 + + delete a PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_pod_disruption_budget_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_pod_disruption_budget" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_pod_disruption_budget`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_pod_disruption_budget`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/policy/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_pod_disruption_budget(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_pod_disruption_budget # noqa: E501 + + list or watch objects of kind PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_pod_disruption_budget(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodDisruptionBudgetList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_pod_disruption_budget_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_pod_disruption_budget_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_pod_disruption_budget # noqa: E501 + + list or watch objects of kind PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_pod_disruption_budget_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodDisruptionBudgetList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_pod_disruption_budget" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_pod_disruption_budget`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodDisruptionBudgetList", + 401: None, + } + + return self.api_client.call_api( + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_pod_disruption_budget_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_pod_disruption_budget_for_all_namespaces # noqa: E501 + + list or watch objects of kind PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pod_disruption_budget_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodDisruptionBudgetList + """ + kwargs['_return_http_data_only'] = True + return self.list_pod_disruption_budget_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_pod_disruption_budget_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_pod_disruption_budget_for_all_namespaces # noqa: E501 + + list or watch objects of kind PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_pod_disruption_budget_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodDisruptionBudgetList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_pod_disruption_budget_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodDisruptionBudgetList", + 401: None, + } + + return self.api_client.call_api( + '/apis/policy/v1/poddisruptionbudgets', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_pod_disruption_budget(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_disruption_budget # noqa: E501 + + partially update the specified PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_disruption_budget(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodDisruptionBudget + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_pod_disruption_budget_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_pod_disruption_budget_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_disruption_budget # noqa: E501 + + partially update the specified PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_disruption_budget_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodDisruptionBudget, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_pod_disruption_budget" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_pod_disruption_budget`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_pod_disruption_budget`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_pod_disruption_budget`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodDisruptionBudget", + 201: "V1PodDisruptionBudget", + 401: None, + } + + return self.api_client.call_api( + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_pod_disruption_budget_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_disruption_budget_status # noqa: E501 + + partially update status of the specified PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_disruption_budget_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodDisruptionBudget + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_pod_disruption_budget_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_pod_disruption_budget_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_pod_disruption_budget_status # noqa: E501 + + partially update status of the specified PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_pod_disruption_budget_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodDisruptionBudget, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_pod_disruption_budget_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_pod_disruption_budget_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_pod_disruption_budget_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_pod_disruption_budget_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodDisruptionBudget", + 201: "V1PodDisruptionBudget", + 401: None, + } + + return self.api_client.call_api( + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_pod_disruption_budget(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_disruption_budget # noqa: E501 + + read the specified PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_disruption_budget(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodDisruptionBudget + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_pod_disruption_budget_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_pod_disruption_budget_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_disruption_budget # noqa: E501 + + read the specified PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_disruption_budget_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodDisruptionBudget, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_pod_disruption_budget" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_pod_disruption_budget`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_pod_disruption_budget`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodDisruptionBudget", + 401: None, + } + + return self.api_client.call_api( + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_pod_disruption_budget_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_disruption_budget_status # noqa: E501 + + read status of the specified PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_disruption_budget_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodDisruptionBudget + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_pod_disruption_budget_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_pod_disruption_budget_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_pod_disruption_budget_status # noqa: E501 + + read status of the specified PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_pod_disruption_budget_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodDisruptionBudget, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_pod_disruption_budget_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_pod_disruption_budget_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_pod_disruption_budget_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodDisruptionBudget", + 401: None, + } + + return self.api_client.call_api( + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_pod_disruption_budget(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_disruption_budget # noqa: E501 + + replace the specified PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_disruption_budget(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PodDisruptionBudget + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodDisruptionBudget + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_pod_disruption_budget_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_pod_disruption_budget_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_disruption_budget # noqa: E501 + + replace the specified PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_disruption_budget_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PodDisruptionBudget + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodDisruptionBudget, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_pod_disruption_budget" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_pod_disruption_budget`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_pod_disruption_budget`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_pod_disruption_budget`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodDisruptionBudget", + 201: "V1PodDisruptionBudget", + 401: None, + } + + return self.api_client.call_api( + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_pod_disruption_budget_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_disruption_budget_status # noqa: E501 + + replace status of the specified PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_disruption_budget_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PodDisruptionBudget + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PodDisruptionBudget + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_pod_disruption_budget_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_pod_disruption_budget_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_pod_disruption_budget_status # noqa: E501 + + replace status of the specified PodDisruptionBudget # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_pod_disruption_budget_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PodDisruptionBudget (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1PodDisruptionBudget + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PodDisruptionBudget, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_pod_disruption_budget_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_pod_disruption_budget_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_pod_disruption_budget_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_pod_disruption_budget_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PodDisruptionBudget", + 201: "V1PodDisruptionBudget", + 401: None, + } + + return self.api_client.call_api( + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/rbac_authorization_api.py b/kubernetes_asyncio/client/api/rbac_authorization_api.py new file mode 100644 index 0000000000..223002d848 --- /dev/null +++ b/kubernetes_asyncio/client/api/rbac_authorization_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class RbacAuthorizationApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/rbac_authorization_v1_api.py b/kubernetes_asyncio/client/api/rbac_authorization_v1_api.py new file mode 100644 index 0000000000..c3c6fde853 --- /dev/null +++ b/kubernetes_asyncio/client/api/rbac_authorization_v1_api.py @@ -0,0 +1,5947 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class RbacAuthorizationV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_cluster_role(self, body, **kwargs): # noqa: E501 + """create_cluster_role # noqa: E501 + + create a ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_cluster_role(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ClusterRole + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ClusterRole + """ + kwargs['_return_http_data_only'] = True + return self.create_cluster_role_with_http_info(body, **kwargs) # noqa: E501 + + def create_cluster_role_with_http_info(self, body, **kwargs): # noqa: E501 + """create_cluster_role # noqa: E501 + + create a ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_cluster_role_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ClusterRole + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ClusterRole, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_cluster_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_cluster_role`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ClusterRole", + 201: "V1ClusterRole", + 202: "V1ClusterRole", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterroles', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_cluster_role_binding(self, body, **kwargs): # noqa: E501 + """create_cluster_role_binding # noqa: E501 + + create a ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_cluster_role_binding(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ClusterRoleBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ClusterRoleBinding + """ + kwargs['_return_http_data_only'] = True + return self.create_cluster_role_binding_with_http_info(body, **kwargs) # noqa: E501 + + def create_cluster_role_binding_with_http_info(self, body, **kwargs): # noqa: E501 + """create_cluster_role_binding # noqa: E501 + + create a ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_cluster_role_binding_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ClusterRoleBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ClusterRoleBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_cluster_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_cluster_role_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ClusterRoleBinding", + 201: "V1ClusterRoleBinding", + 202: "V1ClusterRoleBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_role(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_role # noqa: E501 + + create a Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_role(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Role + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Role + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_role_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_role_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_role # noqa: E501 + + create a Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_role_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Role + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Role, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_role`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_role`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Role", + 201: "V1Role", + 202: "V1Role", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_role_binding(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_role_binding # noqa: E501 + + create a RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_role_binding(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1RoleBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1RoleBinding + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_role_binding_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_role_binding_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_role_binding # noqa: E501 + + create a RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_role_binding_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1RoleBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1RoleBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_role_binding`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_role_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1RoleBinding", + 201: "V1RoleBinding", + 202: "V1RoleBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_cluster_role(self, name, **kwargs): # noqa: E501 + """delete_cluster_role # noqa: E501 + + delete a ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_cluster_role(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRole (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_cluster_role_with_http_info(name, **kwargs) # noqa: E501 + + def delete_cluster_role_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_cluster_role # noqa: E501 + + delete a ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_cluster_role_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRole (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_cluster_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_cluster_role`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_cluster_role_binding(self, name, **kwargs): # noqa: E501 + """delete_cluster_role_binding # noqa: E501 + + delete a ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_cluster_role_binding(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRoleBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_cluster_role_binding_with_http_info(name, **kwargs) # noqa: E501 + + def delete_cluster_role_binding_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_cluster_role_binding # noqa: E501 + + delete a ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_cluster_role_binding_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRoleBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_cluster_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_cluster_role_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_cluster_role(self, **kwargs): # noqa: E501 + """delete_collection_cluster_role # noqa: E501 + + delete collection of ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_cluster_role(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_cluster_role_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_cluster_role_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_cluster_role # noqa: E501 + + delete collection of ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_cluster_role_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_cluster_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterroles', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_cluster_role_binding(self, **kwargs): # noqa: E501 + """delete_collection_cluster_role_binding # noqa: E501 + + delete collection of ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_cluster_role_binding(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_cluster_role_binding_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_cluster_role_binding_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_cluster_role_binding # noqa: E501 + + delete collection of ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_cluster_role_binding_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_cluster_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_role(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_role # noqa: E501 + + delete collection of Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_role(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_role_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_role_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_role # noqa: E501 + + delete collection of Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_role_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_role`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_role_binding(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_role_binding # noqa: E501 + + delete collection of RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_role_binding(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_role_binding_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_role_binding_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_role_binding # noqa: E501 + + delete collection of RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_role_binding_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_role_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_role(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_role # noqa: E501 + + delete a Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_role(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Role (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_role_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_role_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_role # noqa: E501 + + delete a Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_role_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Role (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_role`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_role`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_role_binding(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_role_binding # noqa: E501 + + delete a RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_role_binding(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the RoleBinding (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_role_binding_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_role_binding_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_role_binding # noqa: E501 + + delete a RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_role_binding_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the RoleBinding (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_role_binding`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_role_binding`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_cluster_role(self, **kwargs): # noqa: E501 + """list_cluster_role # noqa: E501 + + list or watch objects of kind ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_cluster_role(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ClusterRoleList + """ + kwargs['_return_http_data_only'] = True + return self.list_cluster_role_with_http_info(**kwargs) # noqa: E501 + + def list_cluster_role_with_http_info(self, **kwargs): # noqa: E501 + """list_cluster_role # noqa: E501 + + list or watch objects of kind ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_cluster_role_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ClusterRoleList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_cluster_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ClusterRoleList", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterroles', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_cluster_role_binding(self, **kwargs): # noqa: E501 + """list_cluster_role_binding # noqa: E501 + + list or watch objects of kind ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_cluster_role_binding(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ClusterRoleBindingList + """ + kwargs['_return_http_data_only'] = True + return self.list_cluster_role_binding_with_http_info(**kwargs) # noqa: E501 + + def list_cluster_role_binding_with_http_info(self, **kwargs): # noqa: E501 + """list_cluster_role_binding # noqa: E501 + + list or watch objects of kind ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_cluster_role_binding_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ClusterRoleBindingList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_cluster_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ClusterRoleBindingList", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_role(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_role # noqa: E501 + + list or watch objects of kind Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_role(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1RoleList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_role_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_role_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_role # noqa: E501 + + list or watch objects of kind Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_role_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1RoleList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_role`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1RoleList", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_role_binding(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_role_binding # noqa: E501 + + list or watch objects of kind RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_role_binding(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1RoleBindingList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_role_binding_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_role_binding_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_role_binding # noqa: E501 + + list or watch objects of kind RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_role_binding_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1RoleBindingList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_role_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1RoleBindingList", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_role_binding_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_role_binding_for_all_namespaces # noqa: E501 + + list or watch objects of kind RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_role_binding_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1RoleBindingList + """ + kwargs['_return_http_data_only'] = True + return self.list_role_binding_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_role_binding_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_role_binding_for_all_namespaces # noqa: E501 + + list or watch objects of kind RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_role_binding_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1RoleBindingList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_role_binding_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1RoleBindingList", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/rolebindings', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_role_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_role_for_all_namespaces # noqa: E501 + + list or watch objects of kind Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_role_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1RoleList + """ + kwargs['_return_http_data_only'] = True + return self.list_role_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_role_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_role_for_all_namespaces # noqa: E501 + + list or watch objects of kind Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_role_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1RoleList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_role_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1RoleList", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/roles', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_cluster_role(self, name, body, **kwargs): # noqa: E501 + """patch_cluster_role # noqa: E501 + + partially update the specified ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_role(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRole (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ClusterRole + """ + kwargs['_return_http_data_only'] = True + return self.patch_cluster_role_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_cluster_role_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_cluster_role # noqa: E501 + + partially update the specified ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_role_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRole (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ClusterRole, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_cluster_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_cluster_role`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_cluster_role`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ClusterRole", + 201: "V1ClusterRole", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_cluster_role_binding(self, name, body, **kwargs): # noqa: E501 + """patch_cluster_role_binding # noqa: E501 + + partially update the specified ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_role_binding(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRoleBinding (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ClusterRoleBinding + """ + kwargs['_return_http_data_only'] = True + return self.patch_cluster_role_binding_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_cluster_role_binding_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_cluster_role_binding # noqa: E501 + + partially update the specified ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_cluster_role_binding_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRoleBinding (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ClusterRoleBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_cluster_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_cluster_role_binding`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_cluster_role_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ClusterRoleBinding", + 201: "V1ClusterRoleBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_role(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_role # noqa: E501 + + partially update the specified Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_role(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Role (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Role + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_role_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_role_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_role # noqa: E501 + + partially update the specified Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_role_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Role (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Role, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_role`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_role`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_role`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Role", + 201: "V1Role", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_role_binding(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_role_binding # noqa: E501 + + partially update the specified RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_role_binding(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the RoleBinding (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1RoleBinding + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_role_binding_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_role_binding_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_role_binding # noqa: E501 + + partially update the specified RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_role_binding_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the RoleBinding (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1RoleBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_role_binding`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_role_binding`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_role_binding`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1RoleBinding", + 201: "V1RoleBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_cluster_role(self, name, **kwargs): # noqa: E501 + """read_cluster_role # noqa: E501 + + read the specified ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_cluster_role(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRole (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ClusterRole + """ + kwargs['_return_http_data_only'] = True + return self.read_cluster_role_with_http_info(name, **kwargs) # noqa: E501 + + def read_cluster_role_with_http_info(self, name, **kwargs): # noqa: E501 + """read_cluster_role # noqa: E501 + + read the specified ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_cluster_role_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRole (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ClusterRole, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_cluster_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_cluster_role`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ClusterRole", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_cluster_role_binding(self, name, **kwargs): # noqa: E501 + """read_cluster_role_binding # noqa: E501 + + read the specified ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_cluster_role_binding(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRoleBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ClusterRoleBinding + """ + kwargs['_return_http_data_only'] = True + return self.read_cluster_role_binding_with_http_info(name, **kwargs) # noqa: E501 + + def read_cluster_role_binding_with_http_info(self, name, **kwargs): # noqa: E501 + """read_cluster_role_binding # noqa: E501 + + read the specified ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_cluster_role_binding_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRoleBinding (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ClusterRoleBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_cluster_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_cluster_role_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ClusterRoleBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_role(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_role # noqa: E501 + + read the specified Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_role(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Role (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Role + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_role_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_role_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_role # noqa: E501 + + read the specified Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_role_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Role (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Role, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_role`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_role`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Role", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_role_binding(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_role_binding # noqa: E501 + + read the specified RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_role_binding(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the RoleBinding (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1RoleBinding + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_role_binding_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_role_binding_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_role_binding # noqa: E501 + + read the specified RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_role_binding_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the RoleBinding (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1RoleBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_role_binding`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_role_binding`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1RoleBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_cluster_role(self, name, body, **kwargs): # noqa: E501 + """replace_cluster_role # noqa: E501 + + replace the specified ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_role(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRole (required) + :type name: str + :param body: (required) + :type body: V1ClusterRole + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ClusterRole + """ + kwargs['_return_http_data_only'] = True + return self.replace_cluster_role_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_cluster_role_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_cluster_role # noqa: E501 + + replace the specified ClusterRole # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_role_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRole (required) + :type name: str + :param body: (required) + :type body: V1ClusterRole + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ClusterRole, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_cluster_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_cluster_role`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_cluster_role`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ClusterRole", + 201: "V1ClusterRole", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_cluster_role_binding(self, name, body, **kwargs): # noqa: E501 + """replace_cluster_role_binding # noqa: E501 + + replace the specified ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_role_binding(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRoleBinding (required) + :type name: str + :param body: (required) + :type body: V1ClusterRoleBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ClusterRoleBinding + """ + kwargs['_return_http_data_only'] = True + return self.replace_cluster_role_binding_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_cluster_role_binding_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_cluster_role_binding # noqa: E501 + + replace the specified ClusterRoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_cluster_role_binding_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ClusterRoleBinding (required) + :type name: str + :param body: (required) + :type body: V1ClusterRoleBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ClusterRoleBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_cluster_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_cluster_role_binding`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_cluster_role_binding`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ClusterRoleBinding", + 201: "V1ClusterRoleBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_role(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_role # noqa: E501 + + replace the specified Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_role(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Role (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Role + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Role + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_role_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_role_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_role # noqa: E501 + + replace the specified Role # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_role_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Role (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1Role + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Role, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_role" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_role`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_role`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_role`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Role", + 201: "V1Role", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_role_binding(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_role_binding # noqa: E501 + + replace the specified RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_role_binding(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the RoleBinding (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1RoleBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1RoleBinding + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_role_binding_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_role_binding_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_role_binding # noqa: E501 + + replace the specified RoleBinding # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_role_binding_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the RoleBinding (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1RoleBinding + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1RoleBinding, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_role_binding" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_role_binding`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_role_binding`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_role_binding`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1RoleBinding", + 201: "V1RoleBinding", + 401: None, + } + + return self.api_client.call_api( + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/resource_api.py b/kubernetes_asyncio/client/api/resource_api.py new file mode 100644 index 0000000000..f267bd8c36 --- /dev/null +++ b/kubernetes_asyncio/client/api/resource_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class ResourceApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/resource_v1_api.py b/kubernetes_asyncio/client/api/resource_v1_api.py new file mode 100644 index 0000000000..fb99d9a6e6 --- /dev/null +++ b/kubernetes_asyncio/client/api/resource_v1_api.py @@ -0,0 +1,6491 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class ResourceV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_device_class(self, body, **kwargs): # noqa: E501 + """create_device_class # noqa: E501 + + create a DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_device_class(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1DeviceClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.create_device_class_with_http_info(body, **kwargs) # noqa: E501 + + def create_device_class_with_http_info(self, body, **kwargs): # noqa: E501 + """create_device_class # noqa: E501 + + create a DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_device_class_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1DeviceClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DeviceClass", + 201: "V1DeviceClass", + 202: "V1DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/deviceclasses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_resource_claim(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_claim # noqa: E501 + + create a ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_claim(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: ResourceV1ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ResourceV1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_resource_claim_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_resource_claim_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_claim # noqa: E501 + + create a ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_claim_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: ResourceV1ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ResourceV1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "ResourceV1ResourceClaim", + 201: "ResourceV1ResourceClaim", + 202: "ResourceV1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_resource_claim_template(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_claim_template # noqa: E501 + + create a ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_claim_template(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ResourceClaimTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_resource_claim_template_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_resource_claim_template_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_claim_template # noqa: E501 + + create a ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_claim_template_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ResourceClaimTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceClaimTemplate", + 201: "V1ResourceClaimTemplate", + 202: "V1ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_resource_slice(self, body, **kwargs): # noqa: E501 + """create_resource_slice # noqa: E501 + + create a ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_resource_slice(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ResourceSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.create_resource_slice_with_http_info(body, **kwargs) # noqa: E501 + + def create_resource_slice_with_http_info(self, body, **kwargs): # noqa: E501 + """create_resource_slice # noqa: E501 + + create a ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_resource_slice_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1ResourceSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceSlice", + 201: "V1ResourceSlice", + 202: "V1ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/resourceslices', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_device_class(self, **kwargs): # noqa: E501 + """delete_collection_device_class # noqa: E501 + + delete collection of DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_device_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_device_class_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_device_class_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_device_class # noqa: E501 + + delete collection of DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_device_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/deviceclasses', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_resource_claim(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_claim # noqa: E501 + + delete collection of ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_claim(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_resource_claim_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_resource_claim_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_claim # noqa: E501 + + delete collection of ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_claim_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_resource_claim_template(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_claim_template # noqa: E501 + + delete collection of ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_claim_template(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_resource_claim_template_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_resource_claim_template_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_claim_template # noqa: E501 + + delete collection of ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_claim_template_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_resource_slice(self, **kwargs): # noqa: E501 + """delete_collection_resource_slice # noqa: E501 + + delete collection of ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_resource_slice(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_resource_slice_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_resource_slice_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_resource_slice # noqa: E501 + + delete collection of ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_resource_slice_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/resourceslices', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_device_class(self, name, **kwargs): # noqa: E501 + """delete_device_class # noqa: E501 + + delete a DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_device_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.delete_device_class_with_http_info(name, **kwargs) # noqa: E501 + + def delete_device_class_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_device_class # noqa: E501 + + delete a DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_device_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DeviceClass", + 202: "V1DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/deviceclasses/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_resource_claim(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_claim # noqa: E501 + + delete a ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_claim(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ResourceV1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_resource_claim_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_resource_claim_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_claim # noqa: E501 + + delete a ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_claim_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ResourceV1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "ResourceV1ResourceClaim", + 202: "ResourceV1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_resource_claim_template(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_claim_template # noqa: E501 + + delete a ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_claim_template(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_resource_claim_template_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_resource_claim_template_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_claim_template # noqa: E501 + + delete a ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_claim_template_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceClaimTemplate", + 202: "V1ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_resource_slice(self, name, **kwargs): # noqa: E501 + """delete_resource_slice # noqa: E501 + + delete a ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_resource_slice(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.delete_resource_slice_with_http_info(name, **kwargs) # noqa: E501 + + def delete_resource_slice_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_resource_slice # noqa: E501 + + delete a ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_resource_slice_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceSlice", + 202: "V1ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/resourceslices/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_device_class(self, **kwargs): # noqa: E501 + """list_device_class # noqa: E501 + + list or watch objects of kind DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_device_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DeviceClassList + """ + kwargs['_return_http_data_only'] = True + return self.list_device_class_with_http_info(**kwargs) # noqa: E501 + + def list_device_class_with_http_info(self, **kwargs): # noqa: E501 + """list_device_class # noqa: E501 + + list or watch objects of kind DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_device_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DeviceClassList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DeviceClassList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/deviceclasses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_resource_claim(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_claim # noqa: E501 + + list or watch objects of kind ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_claim(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceClaimList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_resource_claim_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_resource_claim_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_claim # noqa: E501 + + list or watch objects of kind ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_claim_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceClaimList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceClaimList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_resource_claim_template(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_claim_template # noqa: E501 + + list or watch objects of kind ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_claim_template(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceClaimTemplateList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_resource_claim_template_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_resource_claim_template_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_claim_template # noqa: E501 + + list or watch objects of kind ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_claim_template_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceClaimTemplateList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceClaimTemplateList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_resource_claim_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_resource_claim_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_claim_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceClaimList + """ + kwargs['_return_http_data_only'] = True + return self.list_resource_claim_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_resource_claim_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_resource_claim_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_claim_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceClaimList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_resource_claim_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceClaimList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/resourceclaims', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_resource_claim_template_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_resource_claim_template_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_claim_template_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceClaimTemplateList + """ + kwargs['_return_http_data_only'] = True + return self.list_resource_claim_template_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_resource_claim_template_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_resource_claim_template_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_claim_template_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceClaimTemplateList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_resource_claim_template_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceClaimTemplateList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/resourceclaimtemplates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_resource_slice(self, **kwargs): # noqa: E501 + """list_resource_slice # noqa: E501 + + list or watch objects of kind ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_slice(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceSliceList + """ + kwargs['_return_http_data_only'] = True + return self.list_resource_slice_with_http_info(**kwargs) # noqa: E501 + + def list_resource_slice_with_http_info(self, **kwargs): # noqa: E501 + """list_resource_slice # noqa: E501 + + list or watch objects of kind ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_slice_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceSliceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceSliceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/resourceslices', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_device_class(self, name, body, **kwargs): # noqa: E501 + """patch_device_class # noqa: E501 + + partially update the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_device_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.patch_device_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_device_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_device_class # noqa: E501 + + partially update the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_device_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_device_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DeviceClass", + 201: "V1DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/deviceclasses/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_resource_claim(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim # noqa: E501 + + partially update the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ResourceV1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_resource_claim_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_resource_claim_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim # noqa: E501 + + partially update the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ResourceV1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "ResourceV1ResourceClaim", + 201: "ResourceV1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_resource_claim_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim_status # noqa: E501 + + partially update status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ResourceV1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_resource_claim_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_resource_claim_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim_status # noqa: E501 + + partially update status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ResourceV1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_resource_claim_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_resource_claim_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "ResourceV1ResourceClaim", + 201: "ResourceV1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_resource_claim_template(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim_template # noqa: E501 + + partially update the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_template(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_resource_claim_template_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_resource_claim_template_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim_template # noqa: E501 + + partially update the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_template_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceClaimTemplate", + 201: "V1ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_resource_slice(self, name, body, **kwargs): # noqa: E501 + """patch_resource_slice # noqa: E501 + + partially update the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_resource_slice(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.patch_resource_slice_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_resource_slice_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_resource_slice # noqa: E501 + + partially update the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_resource_slice_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_resource_slice`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceSlice", + 201: "V1ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/resourceslices/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_device_class(self, name, **kwargs): # noqa: E501 + """read_device_class # noqa: E501 + + read the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_device_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.read_device_class_with_http_info(name, **kwargs) # noqa: E501 + + def read_device_class_with_http_info(self, name, **kwargs): # noqa: E501 + """read_device_class # noqa: E501 + + read the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_device_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/deviceclasses/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_resource_claim(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim # noqa: E501 + + read the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ResourceV1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_resource_claim_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_resource_claim_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim # noqa: E501 + + read the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ResourceV1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "ResourceV1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_resource_claim_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim_status # noqa: E501 + + read status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ResourceV1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_resource_claim_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_resource_claim_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim_status # noqa: E501 + + read status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ResourceV1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_resource_claim_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_resource_claim_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "ResourceV1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_resource_claim_template(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim_template # noqa: E501 + + read the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_template(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_resource_claim_template_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_resource_claim_template_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim_template # noqa: E501 + + read the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_template_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_resource_slice(self, name, **kwargs): # noqa: E501 + """read_resource_slice # noqa: E501 + + read the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_resource_slice(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.read_resource_slice_with_http_info(name, **kwargs) # noqa: E501 + + def read_resource_slice_with_http_info(self, name, **kwargs): # noqa: E501 + """read_resource_slice # noqa: E501 + + read the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_resource_slice_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/resourceslices/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_device_class(self, name, body, **kwargs): # noqa: E501 + """replace_device_class # noqa: E501 + + replace the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_device_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param body: (required) + :type body: V1DeviceClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.replace_device_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_device_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_device_class # noqa: E501 + + replace the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_device_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param body: (required) + :type body: V1DeviceClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_device_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1DeviceClass", + 201: "V1DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/deviceclasses/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_resource_claim(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim # noqa: E501 + + replace the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: ResourceV1ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ResourceV1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_resource_claim_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_resource_claim_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim # noqa: E501 + + replace the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: ResourceV1ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ResourceV1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "ResourceV1ResourceClaim", + 201: "ResourceV1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_resource_claim_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim_status # noqa: E501 + + replace status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: ResourceV1ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: ResourceV1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_resource_claim_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_resource_claim_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim_status # noqa: E501 + + replace status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: ResourceV1ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(ResourceV1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_resource_claim_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_resource_claim_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "ResourceV1ResourceClaim", + 201: "ResourceV1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaims/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_resource_claim_template(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim_template # noqa: E501 + + replace the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_template(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ResourceClaimTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_resource_claim_template_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_resource_claim_template_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim_template # noqa: E501 + + replace the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_template_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1ResourceClaimTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceClaimTemplate", + 201: "V1ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/namespaces/{namespace}/resourceclaimtemplates/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_resource_slice(self, name, body, **kwargs): # noqa: E501 + """replace_resource_slice # noqa: E501 + + replace the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_resource_slice(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param body: (required) + :type body: V1ResourceSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.replace_resource_slice_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_resource_slice_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_resource_slice # noqa: E501 + + replace the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_resource_slice_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param body: (required) + :type body: V1ResourceSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_resource_slice`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1ResourceSlice", + 201: "V1ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1/resourceslices/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/resource_v1alpha3_api.py b/kubernetes_asyncio/client/api/resource_v1alpha3_api.py new file mode 100644 index 0000000000..3aab706b2b --- /dev/null +++ b/kubernetes_asyncio/client/api/resource_v1alpha3_api.py @@ -0,0 +1,1987 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class ResourceV1alpha3Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_device_taint_rule(self, body, **kwargs): # noqa: E501 + """create_device_taint_rule # noqa: E501 + + create a DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_device_taint_rule(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1alpha3DeviceTaintRule + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha3DeviceTaintRule + """ + kwargs['_return_http_data_only'] = True + return self.create_device_taint_rule_with_http_info(body, **kwargs) # noqa: E501 + + def create_device_taint_rule_with_http_info(self, body, **kwargs): # noqa: E501 + """create_device_taint_rule # noqa: E501 + + create a DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_device_taint_rule_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1alpha3DeviceTaintRule + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha3DeviceTaintRule, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_device_taint_rule" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_device_taint_rule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha3DeviceTaintRule", + 201: "V1alpha3DeviceTaintRule", + 202: "V1alpha3DeviceTaintRule", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1alpha3/devicetaintrules', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_device_taint_rule(self, **kwargs): # noqa: E501 + """delete_collection_device_taint_rule # noqa: E501 + + delete collection of DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_device_taint_rule(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_device_taint_rule_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_device_taint_rule_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_device_taint_rule # noqa: E501 + + delete collection of DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_device_taint_rule_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_device_taint_rule" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1alpha3/devicetaintrules', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_device_taint_rule(self, name, **kwargs): # noqa: E501 + """delete_device_taint_rule # noqa: E501 + + delete a DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_device_taint_rule(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha3DeviceTaintRule + """ + kwargs['_return_http_data_only'] = True + return self.delete_device_taint_rule_with_http_info(name, **kwargs) # noqa: E501 + + def delete_device_taint_rule_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_device_taint_rule # noqa: E501 + + delete a DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_device_taint_rule_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha3DeviceTaintRule, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_device_taint_rule" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_device_taint_rule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha3DeviceTaintRule", + 202: "V1alpha3DeviceTaintRule", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1alpha3/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_device_taint_rule(self, **kwargs): # noqa: E501 + """list_device_taint_rule # noqa: E501 + + list or watch objects of kind DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_device_taint_rule(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha3DeviceTaintRuleList + """ + kwargs['_return_http_data_only'] = True + return self.list_device_taint_rule_with_http_info(**kwargs) # noqa: E501 + + def list_device_taint_rule_with_http_info(self, **kwargs): # noqa: E501 + """list_device_taint_rule # noqa: E501 + + list or watch objects of kind DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_device_taint_rule_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha3DeviceTaintRuleList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_device_taint_rule" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha3DeviceTaintRuleList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1alpha3/devicetaintrules', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_device_taint_rule(self, name, body, **kwargs): # noqa: E501 + """patch_device_taint_rule # noqa: E501 + + partially update the specified DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_device_taint_rule(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha3DeviceTaintRule + """ + kwargs['_return_http_data_only'] = True + return self.patch_device_taint_rule_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_device_taint_rule_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_device_taint_rule # noqa: E501 + + partially update the specified DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_device_taint_rule_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha3DeviceTaintRule, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_device_taint_rule" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_device_taint_rule`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_device_taint_rule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha3DeviceTaintRule", + 201: "V1alpha3DeviceTaintRule", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_device_taint_rule_status(self, name, body, **kwargs): # noqa: E501 + """patch_device_taint_rule_status # noqa: E501 + + partially update status of the specified DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_device_taint_rule_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha3DeviceTaintRule + """ + kwargs['_return_http_data_only'] = True + return self.patch_device_taint_rule_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_device_taint_rule_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_device_taint_rule_status # noqa: E501 + + partially update status of the specified DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_device_taint_rule_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha3DeviceTaintRule, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_device_taint_rule_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_device_taint_rule_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_device_taint_rule_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha3DeviceTaintRule", + 201: "V1alpha3DeviceTaintRule", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_device_taint_rule(self, name, **kwargs): # noqa: E501 + """read_device_taint_rule # noqa: E501 + + read the specified DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_device_taint_rule(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha3DeviceTaintRule + """ + kwargs['_return_http_data_only'] = True + return self.read_device_taint_rule_with_http_info(name, **kwargs) # noqa: E501 + + def read_device_taint_rule_with_http_info(self, name, **kwargs): # noqa: E501 + """read_device_taint_rule # noqa: E501 + + read the specified DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_device_taint_rule_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha3DeviceTaintRule, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_device_taint_rule" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_device_taint_rule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha3DeviceTaintRule", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_device_taint_rule_status(self, name, **kwargs): # noqa: E501 + """read_device_taint_rule_status # noqa: E501 + + read status of the specified DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_device_taint_rule_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha3DeviceTaintRule + """ + kwargs['_return_http_data_only'] = True + return self.read_device_taint_rule_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_device_taint_rule_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_device_taint_rule_status # noqa: E501 + + read status of the specified DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_device_taint_rule_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha3DeviceTaintRule, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_device_taint_rule_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_device_taint_rule_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha3DeviceTaintRule", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_device_taint_rule(self, name, body, **kwargs): # noqa: E501 + """replace_device_taint_rule # noqa: E501 + + replace the specified DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_device_taint_rule(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param body: (required) + :type body: V1alpha3DeviceTaintRule + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha3DeviceTaintRule + """ + kwargs['_return_http_data_only'] = True + return self.replace_device_taint_rule_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_device_taint_rule_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_device_taint_rule # noqa: E501 + + replace the specified DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_device_taint_rule_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param body: (required) + :type body: V1alpha3DeviceTaintRule + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha3DeviceTaintRule, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_device_taint_rule" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_device_taint_rule`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_device_taint_rule`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha3DeviceTaintRule", + 201: "V1alpha3DeviceTaintRule", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_device_taint_rule_status(self, name, body, **kwargs): # noqa: E501 + """replace_device_taint_rule_status # noqa: E501 + + replace status of the specified DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_device_taint_rule_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param body: (required) + :type body: V1alpha3DeviceTaintRule + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha3DeviceTaintRule + """ + kwargs['_return_http_data_only'] = True + return self.replace_device_taint_rule_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_device_taint_rule_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_device_taint_rule_status # noqa: E501 + + replace status of the specified DeviceTaintRule # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_device_taint_rule_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceTaintRule (required) + :type name: str + :param body: (required) + :type body: V1alpha3DeviceTaintRule + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha3DeviceTaintRule, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_device_taint_rule_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_device_taint_rule_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_device_taint_rule_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha3DeviceTaintRule", + 201: "V1alpha3DeviceTaintRule", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/resource_v1beta1_api.py b/kubernetes_asyncio/client/api/resource_v1beta1_api.py new file mode 100644 index 0000000000..e636cd6b65 --- /dev/null +++ b/kubernetes_asyncio/client/api/resource_v1beta1_api.py @@ -0,0 +1,6491 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class ResourceV1beta1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_device_class(self, body, **kwargs): # noqa: E501 + """create_device_class # noqa: E501 + + create a DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_device_class(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1DeviceClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.create_device_class_with_http_info(body, **kwargs) # noqa: E501 + + def create_device_class_with_http_info(self, body, **kwargs): # noqa: E501 + """create_device_class # noqa: E501 + + create a DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_device_class_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1DeviceClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1DeviceClass", + 201: "V1beta1DeviceClass", + 202: "V1beta1DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/deviceclasses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_resource_claim(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_claim # noqa: E501 + + create a ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_claim(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_resource_claim_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_resource_claim_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_claim # noqa: E501 + + create a ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_claim_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaim", + 201: "V1beta1ResourceClaim", + 202: "V1beta1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_resource_claim_template(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_claim_template # noqa: E501 + + create a ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_claim_template(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1ResourceClaimTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_resource_claim_template_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_resource_claim_template_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_claim_template # noqa: E501 + + create a ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_claim_template_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1ResourceClaimTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaimTemplate", + 201: "V1beta1ResourceClaimTemplate", + 202: "V1beta1ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_resource_slice(self, body, **kwargs): # noqa: E501 + """create_resource_slice # noqa: E501 + + create a ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_resource_slice(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1ResourceSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.create_resource_slice_with_http_info(body, **kwargs) # noqa: E501 + + def create_resource_slice_with_http_info(self, body, **kwargs): # noqa: E501 + """create_resource_slice # noqa: E501 + + create a ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_resource_slice_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1ResourceSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceSlice", + 201: "V1beta1ResourceSlice", + 202: "V1beta1ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/resourceslices', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_device_class(self, **kwargs): # noqa: E501 + """delete_collection_device_class # noqa: E501 + + delete collection of DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_device_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_device_class_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_device_class_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_device_class # noqa: E501 + + delete collection of DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_device_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/deviceclasses', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_resource_claim(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_claim # noqa: E501 + + delete collection of ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_claim(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_resource_claim_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_resource_claim_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_claim # noqa: E501 + + delete collection of ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_claim_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_resource_claim_template(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_claim_template # noqa: E501 + + delete collection of ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_claim_template(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_resource_claim_template_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_resource_claim_template_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_claim_template # noqa: E501 + + delete collection of ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_claim_template_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_resource_slice(self, **kwargs): # noqa: E501 + """delete_collection_resource_slice # noqa: E501 + + delete collection of ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_resource_slice(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_resource_slice_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_resource_slice_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_resource_slice # noqa: E501 + + delete collection of ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_resource_slice_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/resourceslices', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_device_class(self, name, **kwargs): # noqa: E501 + """delete_device_class # noqa: E501 + + delete a DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_device_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.delete_device_class_with_http_info(name, **kwargs) # noqa: E501 + + def delete_device_class_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_device_class # noqa: E501 + + delete a DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_device_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1DeviceClass", + 202: "V1beta1DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/deviceclasses/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_resource_claim(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_claim # noqa: E501 + + delete a ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_claim(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_resource_claim_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_resource_claim_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_claim # noqa: E501 + + delete a ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_claim_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaim", + 202: "V1beta1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_resource_claim_template(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_claim_template # noqa: E501 + + delete a ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_claim_template(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_resource_claim_template_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_resource_claim_template_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_claim_template # noqa: E501 + + delete a ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_claim_template_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaimTemplate", + 202: "V1beta1ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_resource_slice(self, name, **kwargs): # noqa: E501 + """delete_resource_slice # noqa: E501 + + delete a ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_resource_slice(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.delete_resource_slice_with_http_info(name, **kwargs) # noqa: E501 + + def delete_resource_slice_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_resource_slice # noqa: E501 + + delete a ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_resource_slice_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceSlice", + 202: "V1beta1ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/resourceslices/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_device_class(self, **kwargs): # noqa: E501 + """list_device_class # noqa: E501 + + list or watch objects of kind DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_device_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1DeviceClassList + """ + kwargs['_return_http_data_only'] = True + return self.list_device_class_with_http_info(**kwargs) # noqa: E501 + + def list_device_class_with_http_info(self, **kwargs): # noqa: E501 + """list_device_class # noqa: E501 + + list or watch objects of kind DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_device_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1DeviceClassList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1DeviceClassList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/deviceclasses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_resource_claim(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_claim # noqa: E501 + + list or watch objects of kind ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_claim(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaimList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_resource_claim_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_resource_claim_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_claim # noqa: E501 + + list or watch objects of kind ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_claim_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaimList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaimList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_resource_claim_template(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_claim_template # noqa: E501 + + list or watch objects of kind ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_claim_template(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaimTemplateList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_resource_claim_template_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_resource_claim_template_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_claim_template # noqa: E501 + + list or watch objects of kind ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_claim_template_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaimTemplateList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaimTemplateList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_resource_claim_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_resource_claim_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_claim_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaimList + """ + kwargs['_return_http_data_only'] = True + return self.list_resource_claim_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_resource_claim_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_resource_claim_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_claim_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaimList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_resource_claim_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaimList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/resourceclaims', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_resource_claim_template_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_resource_claim_template_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_claim_template_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaimTemplateList + """ + kwargs['_return_http_data_only'] = True + return self.list_resource_claim_template_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_resource_claim_template_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_resource_claim_template_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_claim_template_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaimTemplateList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_resource_claim_template_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaimTemplateList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/resourceclaimtemplates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_resource_slice(self, **kwargs): # noqa: E501 + """list_resource_slice # noqa: E501 + + list or watch objects of kind ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_slice(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceSliceList + """ + kwargs['_return_http_data_only'] = True + return self.list_resource_slice_with_http_info(**kwargs) # noqa: E501 + + def list_resource_slice_with_http_info(self, **kwargs): # noqa: E501 + """list_resource_slice # noqa: E501 + + list or watch objects of kind ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_slice_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceSliceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceSliceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/resourceslices', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_device_class(self, name, body, **kwargs): # noqa: E501 + """patch_device_class # noqa: E501 + + partially update the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_device_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.patch_device_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_device_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_device_class # noqa: E501 + + partially update the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_device_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_device_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1DeviceClass", + 201: "V1beta1DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/deviceclasses/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_resource_claim(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim # noqa: E501 + + partially update the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_resource_claim_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_resource_claim_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim # noqa: E501 + + partially update the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaim", + 201: "V1beta1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_resource_claim_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim_status # noqa: E501 + + partially update status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_resource_claim_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_resource_claim_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim_status # noqa: E501 + + partially update status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_resource_claim_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_resource_claim_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaim", + 201: "V1beta1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_resource_claim_template(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim_template # noqa: E501 + + partially update the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_template(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_resource_claim_template_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_resource_claim_template_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim_template # noqa: E501 + + partially update the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_template_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaimTemplate", + 201: "V1beta1ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_resource_slice(self, name, body, **kwargs): # noqa: E501 + """patch_resource_slice # noqa: E501 + + partially update the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_resource_slice(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.patch_resource_slice_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_resource_slice_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_resource_slice # noqa: E501 + + partially update the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_resource_slice_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_resource_slice`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceSlice", + 201: "V1beta1ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/resourceslices/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_device_class(self, name, **kwargs): # noqa: E501 + """read_device_class # noqa: E501 + + read the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_device_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.read_device_class_with_http_info(name, **kwargs) # noqa: E501 + + def read_device_class_with_http_info(self, name, **kwargs): # noqa: E501 + """read_device_class # noqa: E501 + + read the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_device_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/deviceclasses/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_resource_claim(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim # noqa: E501 + + read the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_resource_claim_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_resource_claim_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim # noqa: E501 + + read the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_resource_claim_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim_status # noqa: E501 + + read status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_resource_claim_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_resource_claim_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim_status # noqa: E501 + + read status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_resource_claim_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_resource_claim_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_resource_claim_template(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim_template # noqa: E501 + + read the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_template(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_resource_claim_template_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_resource_claim_template_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim_template # noqa: E501 + + read the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_template_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_resource_slice(self, name, **kwargs): # noqa: E501 + """read_resource_slice # noqa: E501 + + read the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_resource_slice(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.read_resource_slice_with_http_info(name, **kwargs) # noqa: E501 + + def read_resource_slice_with_http_info(self, name, **kwargs): # noqa: E501 + """read_resource_slice # noqa: E501 + + read the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_resource_slice_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/resourceslices/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_device_class(self, name, body, **kwargs): # noqa: E501 + """replace_device_class # noqa: E501 + + replace the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_device_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param body: (required) + :type body: V1beta1DeviceClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.replace_device_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_device_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_device_class # noqa: E501 + + replace the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_device_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param body: (required) + :type body: V1beta1DeviceClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_device_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1DeviceClass", + 201: "V1beta1DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/deviceclasses/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_resource_claim(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim # noqa: E501 + + replace the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_resource_claim_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_resource_claim_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim # noqa: E501 + + replace the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaim", + 201: "V1beta1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_resource_claim_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim_status # noqa: E501 + + replace status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_resource_claim_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_resource_claim_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim_status # noqa: E501 + + replace status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_resource_claim_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_resource_claim_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaim", + 201: "V1beta1ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaims/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_resource_claim_template(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim_template # noqa: E501 + + replace the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_template(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1ResourceClaimTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_resource_claim_template_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_resource_claim_template_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim_template # noqa: E501 + + replace the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_template_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta1ResourceClaimTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceClaimTemplate", + 201: "V1beta1ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/namespaces/{namespace}/resourceclaimtemplates/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_resource_slice(self, name, body, **kwargs): # noqa: E501 + """replace_resource_slice # noqa: E501 + + replace the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_resource_slice(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param body: (required) + :type body: V1beta1ResourceSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.replace_resource_slice_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_resource_slice_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_resource_slice # noqa: E501 + + replace the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_resource_slice_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param body: (required) + :type body: V1beta1ResourceSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_resource_slice`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1ResourceSlice", + 201: "V1beta1ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta1/resourceslices/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/resource_v1beta2_api.py b/kubernetes_asyncio/client/api/resource_v1beta2_api.py new file mode 100644 index 0000000000..b106aad4f2 --- /dev/null +++ b/kubernetes_asyncio/client/api/resource_v1beta2_api.py @@ -0,0 +1,6491 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class ResourceV1beta2Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_device_class(self, body, **kwargs): # noqa: E501 + """create_device_class # noqa: E501 + + create a DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_device_class(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta2DeviceClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.create_device_class_with_http_info(body, **kwargs) # noqa: E501 + + def create_device_class_with_http_info(self, body, **kwargs): # noqa: E501 + """create_device_class # noqa: E501 + + create a DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_device_class_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta2DeviceClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2DeviceClass", + 201: "V1beta2DeviceClass", + 202: "V1beta2DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/deviceclasses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_resource_claim(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_claim # noqa: E501 + + create a ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_claim(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta2ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_resource_claim_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_resource_claim_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_claim # noqa: E501 + + create a ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_claim_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta2ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaim", + 201: "V1beta2ResourceClaim", + 202: "V1beta2ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_resource_claim_template(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_claim_template # noqa: E501 + + create a ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_claim_template(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta2ResourceClaimTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_resource_claim_template_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_resource_claim_template_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_resource_claim_template # noqa: E501 + + create a ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_resource_claim_template_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta2ResourceClaimTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaimTemplate", + 201: "V1beta2ResourceClaimTemplate", + 202: "V1beta2ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_resource_slice(self, body, **kwargs): # noqa: E501 + """create_resource_slice # noqa: E501 + + create a ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_resource_slice(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta2ResourceSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.create_resource_slice_with_http_info(body, **kwargs) # noqa: E501 + + def create_resource_slice_with_http_info(self, body, **kwargs): # noqa: E501 + """create_resource_slice # noqa: E501 + + create a ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_resource_slice_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta2ResourceSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceSlice", + 201: "V1beta2ResourceSlice", + 202: "V1beta2ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/resourceslices', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_device_class(self, **kwargs): # noqa: E501 + """delete_collection_device_class # noqa: E501 + + delete collection of DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_device_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_device_class_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_device_class_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_device_class # noqa: E501 + + delete collection of DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_device_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/deviceclasses', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_resource_claim(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_claim # noqa: E501 + + delete collection of ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_claim(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_resource_claim_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_resource_claim_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_claim # noqa: E501 + + delete collection of ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_claim_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_resource_claim_template(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_claim_template # noqa: E501 + + delete collection of ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_claim_template(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_resource_claim_template_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_resource_claim_template_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_resource_claim_template # noqa: E501 + + delete collection of ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_resource_claim_template_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_resource_slice(self, **kwargs): # noqa: E501 + """delete_collection_resource_slice # noqa: E501 + + delete collection of ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_resource_slice(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_resource_slice_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_resource_slice_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_resource_slice # noqa: E501 + + delete collection of ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_resource_slice_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/resourceslices', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_device_class(self, name, **kwargs): # noqa: E501 + """delete_device_class # noqa: E501 + + delete a DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_device_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.delete_device_class_with_http_info(name, **kwargs) # noqa: E501 + + def delete_device_class_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_device_class # noqa: E501 + + delete a DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_device_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2DeviceClass", + 202: "V1beta2DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/deviceclasses/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_resource_claim(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_claim # noqa: E501 + + delete a ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_claim(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_resource_claim_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_resource_claim_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_claim # noqa: E501 + + delete a ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_claim_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaim", + 202: "V1beta2ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_resource_claim_template(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_claim_template # noqa: E501 + + delete a ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_claim_template(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_resource_claim_template_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_resource_claim_template_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_resource_claim_template # noqa: E501 + + delete a ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_resource_claim_template_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaimTemplate", + 202: "V1beta2ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_resource_slice(self, name, **kwargs): # noqa: E501 + """delete_resource_slice # noqa: E501 + + delete a ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_resource_slice(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.delete_resource_slice_with_http_info(name, **kwargs) # noqa: E501 + + def delete_resource_slice_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_resource_slice # noqa: E501 + + delete a ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_resource_slice_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceSlice", + 202: "V1beta2ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/resourceslices/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_device_class(self, **kwargs): # noqa: E501 + """list_device_class # noqa: E501 + + list or watch objects of kind DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_device_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2DeviceClassList + """ + kwargs['_return_http_data_only'] = True + return self.list_device_class_with_http_info(**kwargs) # noqa: E501 + + def list_device_class_with_http_info(self, **kwargs): # noqa: E501 + """list_device_class # noqa: E501 + + list or watch objects of kind DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_device_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2DeviceClassList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2DeviceClassList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/deviceclasses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_resource_claim(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_claim # noqa: E501 + + list or watch objects of kind ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_claim(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaimList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_resource_claim_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_resource_claim_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_claim # noqa: E501 + + list or watch objects of kind ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_claim_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaimList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaimList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_resource_claim_template(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_claim_template # noqa: E501 + + list or watch objects of kind ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_claim_template(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaimTemplateList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_resource_claim_template_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_resource_claim_template_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_resource_claim_template # noqa: E501 + + list or watch objects of kind ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_resource_claim_template_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaimTemplateList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaimTemplateList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_resource_claim_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_resource_claim_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_claim_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaimList + """ + kwargs['_return_http_data_only'] = True + return self.list_resource_claim_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_resource_claim_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_resource_claim_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_claim_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaimList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_resource_claim_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaimList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/resourceclaims', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_resource_claim_template_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_resource_claim_template_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_claim_template_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaimTemplateList + """ + kwargs['_return_http_data_only'] = True + return self.list_resource_claim_template_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_resource_claim_template_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_resource_claim_template_for_all_namespaces # noqa: E501 + + list or watch objects of kind ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_claim_template_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaimTemplateList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_resource_claim_template_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaimTemplateList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/resourceclaimtemplates', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_resource_slice(self, **kwargs): # noqa: E501 + """list_resource_slice # noqa: E501 + + list or watch objects of kind ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_slice(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceSliceList + """ + kwargs['_return_http_data_only'] = True + return self.list_resource_slice_with_http_info(**kwargs) # noqa: E501 + + def list_resource_slice_with_http_info(self, **kwargs): # noqa: E501 + """list_resource_slice # noqa: E501 + + list or watch objects of kind ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_resource_slice_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceSliceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceSliceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/resourceslices', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_device_class(self, name, body, **kwargs): # noqa: E501 + """patch_device_class # noqa: E501 + + partially update the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_device_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.patch_device_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_device_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_device_class # noqa: E501 + + partially update the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_device_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_device_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2DeviceClass", + 201: "V1beta2DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/deviceclasses/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_resource_claim(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim # noqa: E501 + + partially update the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_resource_claim_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_resource_claim_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim # noqa: E501 + + partially update the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaim", + 201: "V1beta2ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_resource_claim_status(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim_status # noqa: E501 + + partially update status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_resource_claim_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_resource_claim_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim_status # noqa: E501 + + partially update status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_resource_claim_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_resource_claim_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaim", + 201: "V1beta2ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_resource_claim_template(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim_template # noqa: E501 + + partially update the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_template(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_resource_claim_template_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_resource_claim_template_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_resource_claim_template # noqa: E501 + + partially update the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_resource_claim_template_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaimTemplate", + 201: "V1beta2ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_resource_slice(self, name, body, **kwargs): # noqa: E501 + """patch_resource_slice # noqa: E501 + + partially update the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_resource_slice(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.patch_resource_slice_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_resource_slice_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_resource_slice # noqa: E501 + + partially update the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_resource_slice_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_resource_slice`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceSlice", + 201: "V1beta2ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/resourceslices/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_device_class(self, name, **kwargs): # noqa: E501 + """read_device_class # noqa: E501 + + read the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_device_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.read_device_class_with_http_info(name, **kwargs) # noqa: E501 + + def read_device_class_with_http_info(self, name, **kwargs): # noqa: E501 + """read_device_class # noqa: E501 + + read the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_device_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/deviceclasses/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_resource_claim(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim # noqa: E501 + + read the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_resource_claim_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_resource_claim_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim # noqa: E501 + + read the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_resource_claim_status(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim_status # noqa: E501 + + read status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_status(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_resource_claim_status_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_resource_claim_status_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim_status # noqa: E501 + + read status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_status_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_resource_claim_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_resource_claim_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_resource_claim_template(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim_template # noqa: E501 + + read the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_template(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_resource_claim_template_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_resource_claim_template_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_resource_claim_template # noqa: E501 + + read the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_resource_claim_template_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_resource_slice(self, name, **kwargs): # noqa: E501 + """read_resource_slice # noqa: E501 + + read the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_resource_slice(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.read_resource_slice_with_http_info(name, **kwargs) # noqa: E501 + + def read_resource_slice_with_http_info(self, name, **kwargs): # noqa: E501 + """read_resource_slice # noqa: E501 + + read the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_resource_slice_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/resourceslices/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_device_class(self, name, body, **kwargs): # noqa: E501 + """replace_device_class # noqa: E501 + + replace the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_device_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param body: (required) + :type body: V1beta2DeviceClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2DeviceClass + """ + kwargs['_return_http_data_only'] = True + return self.replace_device_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_device_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_device_class # noqa: E501 + + replace the specified DeviceClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_device_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the DeviceClass (required) + :type name: str + :param body: (required) + :type body: V1beta2DeviceClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2DeviceClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_device_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_device_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_device_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2DeviceClass", + 201: "V1beta2DeviceClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/deviceclasses/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_resource_claim(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim # noqa: E501 + + replace the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta2ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_resource_claim_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_resource_claim_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim # noqa: E501 + + replace the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta2ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_resource_claim" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_resource_claim`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_resource_claim`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaim", + 201: "V1beta2ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_resource_claim_status(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim_status # noqa: E501 + + replace status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_status(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta2ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaim + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_resource_claim_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_resource_claim_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim_status # noqa: E501 + + replace status of the specified ResourceClaim # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_status_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaim (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta2ResourceClaim + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaim, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_resource_claim_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_resource_claim_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_resource_claim_status`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaim", + 201: "V1beta2ResourceClaim", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaims/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_resource_claim_template(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim_template # noqa: E501 + + replace the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_template(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta2ResourceClaimTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceClaimTemplate + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_resource_claim_template_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_resource_claim_template_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_resource_claim_template # noqa: E501 + + replace the specified ResourceClaimTemplate # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_resource_claim_template_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceClaimTemplate (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1beta2ResourceClaimTemplate + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceClaimTemplate, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_resource_claim_template" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_resource_claim_template`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_resource_claim_template`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceClaimTemplate", + 201: "V1beta2ResourceClaimTemplate", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/namespaces/{namespace}/resourceclaimtemplates/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_resource_slice(self, name, body, **kwargs): # noqa: E501 + """replace_resource_slice # noqa: E501 + + replace the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_resource_slice(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param body: (required) + :type body: V1beta2ResourceSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta2ResourceSlice + """ + kwargs['_return_http_data_only'] = True + return self.replace_resource_slice_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_resource_slice_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_resource_slice # noqa: E501 + + replace the specified ResourceSlice # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_resource_slice_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the ResourceSlice (required) + :type name: str + :param body: (required) + :type body: V1beta2ResourceSlice + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta2ResourceSlice, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_resource_slice" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_resource_slice`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_resource_slice`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta2ResourceSlice", + 201: "V1beta2ResourceSlice", + 401: None, + } + + return self.api_client.call_api( + '/apis/resource.k8s.io/v1beta2/resourceslices/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/scheduling_api.py b/kubernetes_asyncio/client/api/scheduling_api.py new file mode 100644 index 0000000000..7a9d16b59c --- /dev/null +++ b/kubernetes_asyncio/client/api/scheduling_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class SchedulingApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/scheduling_v1_api.py b/kubernetes_asyncio/client/api/scheduling_v1_api.py new file mode 100644 index 0000000000..bdd3f98d52 --- /dev/null +++ b/kubernetes_asyncio/client/api/scheduling_v1_api.py @@ -0,0 +1,1473 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class SchedulingV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_priority_class(self, body, **kwargs): # noqa: E501 + """create_priority_class # noqa: E501 + + create a PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_priority_class(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1PriorityClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PriorityClass + """ + kwargs['_return_http_data_only'] = True + return self.create_priority_class_with_http_info(body, **kwargs) # noqa: E501 + + def create_priority_class_with_http_info(self, body, **kwargs): # noqa: E501 + """create_priority_class # noqa: E501 + + create a PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_priority_class_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1PriorityClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PriorityClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_priority_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_priority_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PriorityClass", + 201: "V1PriorityClass", + 202: "V1PriorityClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1/priorityclasses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_priority_class(self, **kwargs): # noqa: E501 + """delete_collection_priority_class # noqa: E501 + + delete collection of PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_priority_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_priority_class_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_priority_class_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_priority_class # noqa: E501 + + delete collection of PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_priority_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_priority_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1/priorityclasses', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_priority_class(self, name, **kwargs): # noqa: E501 + """delete_priority_class # noqa: E501 + + delete a PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_priority_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_priority_class_with_http_info(name, **kwargs) # noqa: E501 + + def delete_priority_class_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_priority_class # noqa: E501 + + delete a PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_priority_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_priority_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_priority_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1/priorityclasses/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_priority_class(self, **kwargs): # noqa: E501 + """list_priority_class # noqa: E501 + + list or watch objects of kind PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_priority_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PriorityClassList + """ + kwargs['_return_http_data_only'] = True + return self.list_priority_class_with_http_info(**kwargs) # noqa: E501 + + def list_priority_class_with_http_info(self, **kwargs): # noqa: E501 + """list_priority_class # noqa: E501 + + list or watch objects of kind PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_priority_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PriorityClassList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_priority_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PriorityClassList", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1/priorityclasses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_priority_class(self, name, body, **kwargs): # noqa: E501 + """patch_priority_class # noqa: E501 + + partially update the specified PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_priority_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PriorityClass + """ + kwargs['_return_http_data_only'] = True + return self.patch_priority_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_priority_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_priority_class # noqa: E501 + + partially update the specified PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_priority_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PriorityClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_priority_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_priority_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_priority_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PriorityClass", + 201: "V1PriorityClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1/priorityclasses/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_priority_class(self, name, **kwargs): # noqa: E501 + """read_priority_class # noqa: E501 + + read the specified PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_priority_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PriorityClass + """ + kwargs['_return_http_data_only'] = True + return self.read_priority_class_with_http_info(name, **kwargs) # noqa: E501 + + def read_priority_class_with_http_info(self, name, **kwargs): # noqa: E501 + """read_priority_class # noqa: E501 + + read the specified PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_priority_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PriorityClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_priority_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_priority_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PriorityClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1/priorityclasses/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_priority_class(self, name, body, **kwargs): # noqa: E501 + """replace_priority_class # noqa: E501 + + replace the specified PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_priority_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityClass (required) + :type name: str + :param body: (required) + :type body: V1PriorityClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1PriorityClass + """ + kwargs['_return_http_data_only'] = True + return self.replace_priority_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_priority_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_priority_class # noqa: E501 + + replace the specified PriorityClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_priority_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the PriorityClass (required) + :type name: str + :param body: (required) + :type body: V1PriorityClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1PriorityClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_priority_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_priority_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_priority_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1PriorityClass", + 201: "V1PriorityClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1/priorityclasses/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/scheduling_v1alpha1_api.py b/kubernetes_asyncio/client/api/scheduling_v1alpha1_api.py new file mode 100644 index 0000000000..a71a354899 --- /dev/null +++ b/kubernetes_asyncio/client/api/scheduling_v1alpha1_api.py @@ -0,0 +1,1748 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class SchedulingV1alpha1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_namespaced_workload(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_workload # noqa: E501 + + create a Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_workload(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1alpha1Workload + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1Workload + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_workload_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_workload_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_workload # noqa: E501 + + create a Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_workload_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1alpha1Workload + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1Workload, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_workload" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_workload`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_workload`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1Workload", + 201: "V1alpha1Workload", + 202: "V1alpha1Workload", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_workload(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_workload # noqa: E501 + + delete collection of Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_workload(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_workload_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_workload_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_workload # noqa: E501 + + delete collection of Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_workload_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_workload" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_workload`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_workload(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_workload # noqa: E501 + + delete a Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_workload(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Workload (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_workload_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_workload_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_workload # noqa: E501 + + delete a Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_workload_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Workload (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_workload" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_workload`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_workload`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1alpha1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_workload(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_workload # noqa: E501 + + list or watch objects of kind Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_workload(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1WorkloadList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_workload_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_workload_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_workload # noqa: E501 + + list or watch objects of kind Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_workload_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1WorkloadList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_workload" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_workload`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1WorkloadList", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_workload_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_workload_for_all_namespaces # noqa: E501 + + list or watch objects of kind Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_workload_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1WorkloadList + """ + kwargs['_return_http_data_only'] = True + return self.list_workload_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_workload_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_workload_for_all_namespaces # noqa: E501 + + list or watch objects of kind Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_workload_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1WorkloadList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_workload_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1WorkloadList", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1alpha1/workloads', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_workload(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_workload # noqa: E501 + + partially update the specified Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_workload(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Workload (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1Workload + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_workload_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_workload_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_workload # noqa: E501 + + partially update the specified Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_workload_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Workload (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1Workload, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_workload" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_workload`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_workload`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_workload`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1Workload", + 201: "V1alpha1Workload", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_workload(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_workload # noqa: E501 + + read the specified Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_workload(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Workload (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1Workload + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_workload_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_workload_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_workload # noqa: E501 + + read the specified Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_workload_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the Workload (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1Workload, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_workload" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_workload`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_workload`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1Workload", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_workload(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_workload # noqa: E501 + + replace the specified Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_workload(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Workload (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1alpha1Workload + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1alpha1Workload + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_workload_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_workload_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_workload # noqa: E501 + + replace the specified Workload # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_workload_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the Workload (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1alpha1Workload + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1alpha1Workload, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_workload" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_workload`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_workload`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_workload`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1alpha1Workload", + 201: "V1alpha1Workload", + 401: None, + } + + return self.api_client.call_api( + '/apis/scheduling.k8s.io/v1alpha1/namespaces/{namespace}/workloads/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/storage_api.py b/kubernetes_asyncio/client/api/storage_api.py new file mode 100644 index 0000000000..2af03d4886 --- /dev/null +++ b/kubernetes_asyncio/client/api/storage_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class StorageApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/storage_v1_api.py b/kubernetes_asyncio/client/api/storage_v1_api.py new file mode 100644 index 0000000000..9cfaa656fa --- /dev/null +++ b/kubernetes_asyncio/client/api/storage_v1_api.py @@ -0,0 +1,8802 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class StorageV1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_csi_driver(self, body, **kwargs): # noqa: E501 + """create_csi_driver # noqa: E501 + + create a CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_csi_driver(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1CSIDriver + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSIDriver + """ + kwargs['_return_http_data_only'] = True + return self.create_csi_driver_with_http_info(body, **kwargs) # noqa: E501 + + def create_csi_driver_with_http_info(self, body, **kwargs): # noqa: E501 + """create_csi_driver # noqa: E501 + + create a CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_csi_driver_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1CSIDriver + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSIDriver, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_csi_driver" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_csi_driver`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSIDriver", + 201: "V1CSIDriver", + 202: "V1CSIDriver", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csidrivers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_csi_node(self, body, **kwargs): # noqa: E501 + """create_csi_node # noqa: E501 + + create a CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_csi_node(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1CSINode + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSINode + """ + kwargs['_return_http_data_only'] = True + return self.create_csi_node_with_http_info(body, **kwargs) # noqa: E501 + + def create_csi_node_with_http_info(self, body, **kwargs): # noqa: E501 + """create_csi_node # noqa: E501 + + create a CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_csi_node_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1CSINode + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSINode, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_csi_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_csi_node`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSINode", + 201: "V1CSINode", + 202: "V1CSINode", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csinodes', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_namespaced_csi_storage_capacity(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_csi_storage_capacity # noqa: E501 + + create a CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_csi_storage_capacity(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1CSIStorageCapacity + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSIStorageCapacity + """ + kwargs['_return_http_data_only'] = True + return self.create_namespaced_csi_storage_capacity_with_http_info(namespace, body, **kwargs) # noqa: E501 + + def create_namespaced_csi_storage_capacity_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + """create_namespaced_csi_storage_capacity # noqa: E501 + + create a CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_namespaced_csi_storage_capacity_with_http_info(namespace, body, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1CSIStorageCapacity + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSIStorageCapacity, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_namespaced_csi_storage_capacity" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `create_namespaced_csi_storage_capacity`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_namespaced_csi_storage_capacity`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSIStorageCapacity", + 201: "V1CSIStorageCapacity", + 202: "V1CSIStorageCapacity", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_storage_class(self, body, **kwargs): # noqa: E501 + """create_storage_class # noqa: E501 + + create a StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_storage_class(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1StorageClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StorageClass + """ + kwargs['_return_http_data_only'] = True + return self.create_storage_class_with_http_info(body, **kwargs) # noqa: E501 + + def create_storage_class_with_http_info(self, body, **kwargs): # noqa: E501 + """create_storage_class # noqa: E501 + + create a StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_storage_class_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1StorageClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StorageClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_storage_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_storage_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StorageClass", + 201: "V1StorageClass", + 202: "V1StorageClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/storageclasses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_volume_attachment(self, body, **kwargs): # noqa: E501 + """create_volume_attachment # noqa: E501 + + create a VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_volume_attachment(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1VolumeAttachment + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttachment + """ + kwargs['_return_http_data_only'] = True + return self.create_volume_attachment_with_http_info(body, **kwargs) # noqa: E501 + + def create_volume_attachment_with_http_info(self, body, **kwargs): # noqa: E501 + """create_volume_attachment # noqa: E501 + + create a VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_volume_attachment_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1VolumeAttachment + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttachment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_volume_attachment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_volume_attachment`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttachment", + 201: "V1VolumeAttachment", + 202: "V1VolumeAttachment", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattachments', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def create_volume_attributes_class(self, body, **kwargs): # noqa: E501 + """create_volume_attributes_class # noqa: E501 + + create a VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_volume_attributes_class(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1VolumeAttributesClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttributesClass + """ + kwargs['_return_http_data_only'] = True + return self.create_volume_attributes_class_with_http_info(body, **kwargs) # noqa: E501 + + def create_volume_attributes_class_with_http_info(self, body, **kwargs): # noqa: E501 + """create_volume_attributes_class # noqa: E501 + + create a VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_volume_attributes_class_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1VolumeAttributesClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttributesClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_volume_attributes_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttributesClass", + 201: "V1VolumeAttributesClass", + 202: "V1VolumeAttributesClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattributesclasses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_csi_driver(self, **kwargs): # noqa: E501 + """delete_collection_csi_driver # noqa: E501 + + delete collection of CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_csi_driver(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_csi_driver_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_csi_driver_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_csi_driver # noqa: E501 + + delete collection of CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_csi_driver_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_csi_driver" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csidrivers', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_csi_node(self, **kwargs): # noqa: E501 + """delete_collection_csi_node # noqa: E501 + + delete collection of CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_csi_node(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_csi_node_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_csi_node_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_csi_node # noqa: E501 + + delete collection of CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_csi_node_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_csi_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csinodes', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_namespaced_csi_storage_capacity(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_csi_storage_capacity # noqa: E501 + + delete collection of CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_csi_storage_capacity(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_namespaced_csi_storage_capacity_with_http_info(namespace, **kwargs) # noqa: E501 + + def delete_collection_namespaced_csi_storage_capacity_with_http_info(self, namespace, **kwargs): # noqa: E501 + """delete_collection_namespaced_csi_storage_capacity # noqa: E501 + + delete collection of CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_namespaced_csi_storage_capacity_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_namespaced_csi_storage_capacity" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_csi_storage_capacity`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_storage_class(self, **kwargs): # noqa: E501 + """delete_collection_storage_class # noqa: E501 + + delete collection of StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_storage_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_storage_class_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_storage_class_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_storage_class # noqa: E501 + + delete collection of StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_storage_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_storage_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/storageclasses', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_volume_attachment(self, **kwargs): # noqa: E501 + """delete_collection_volume_attachment # noqa: E501 + + delete collection of VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_volume_attachment(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_volume_attachment_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_volume_attachment_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_volume_attachment # noqa: E501 + + delete collection of VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_volume_attachment_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_volume_attachment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattachments', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_volume_attributes_class(self, **kwargs): # noqa: E501 + """delete_collection_volume_attributes_class # noqa: E501 + + delete collection of VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_volume_attributes_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_volume_attributes_class_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_volume_attributes_class_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_volume_attributes_class # noqa: E501 + + delete collection of VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_volume_attributes_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattributesclasses', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_csi_driver(self, name, **kwargs): # noqa: E501 + """delete_csi_driver # noqa: E501 + + delete a CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_csi_driver(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIDriver (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSIDriver + """ + kwargs['_return_http_data_only'] = True + return self.delete_csi_driver_with_http_info(name, **kwargs) # noqa: E501 + + def delete_csi_driver_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_csi_driver # noqa: E501 + + delete a CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_csi_driver_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIDriver (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSIDriver, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_csi_driver" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_csi_driver`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSIDriver", + 202: "V1CSIDriver", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csidrivers/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_csi_node(self, name, **kwargs): # noqa: E501 + """delete_csi_node # noqa: E501 + + delete a CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_csi_node(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CSINode (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSINode + """ + kwargs['_return_http_data_only'] = True + return self.delete_csi_node_with_http_info(name, **kwargs) # noqa: E501 + + def delete_csi_node_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_csi_node # noqa: E501 + + delete a CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_csi_node_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CSINode (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSINode, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_csi_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_csi_node`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSINode", + 202: "V1CSINode", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csinodes/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_namespaced_csi_storage_capacity(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_csi_storage_capacity # noqa: E501 + + delete a CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_csi_storage_capacity(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIStorageCapacity (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_namespaced_csi_storage_capacity_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def delete_namespaced_csi_storage_capacity_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """delete_namespaced_csi_storage_capacity # noqa: E501 + + delete a CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_namespaced_csi_storage_capacity_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIStorageCapacity (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_namespaced_csi_storage_capacity" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_namespaced_csi_storage_capacity`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `delete_namespaced_csi_storage_capacity`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_storage_class(self, name, **kwargs): # noqa: E501 + """delete_storage_class # noqa: E501 + + delete a StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_storage_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StorageClass + """ + kwargs['_return_http_data_only'] = True + return self.delete_storage_class_with_http_info(name, **kwargs) # noqa: E501 + + def delete_storage_class_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_storage_class # noqa: E501 + + delete a StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_storage_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StorageClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_storage_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_storage_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StorageClass", + 202: "V1StorageClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/storageclasses/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_volume_attachment(self, name, **kwargs): # noqa: E501 + """delete_volume_attachment # noqa: E501 + + delete a VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_volume_attachment(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttachment + """ + kwargs['_return_http_data_only'] = True + return self.delete_volume_attachment_with_http_info(name, **kwargs) # noqa: E501 + + def delete_volume_attachment_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_volume_attachment # noqa: E501 + + delete a VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_volume_attachment_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttachment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_volume_attachment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_volume_attachment`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttachment", + 202: "V1VolumeAttachment", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattachments/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_volume_attributes_class(self, name, **kwargs): # noqa: E501 + """delete_volume_attributes_class # noqa: E501 + + delete a VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_volume_attributes_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttributesClass + """ + kwargs['_return_http_data_only'] = True + return self.delete_volume_attributes_class_with_http_info(name, **kwargs) # noqa: E501 + + def delete_volume_attributes_class_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_volume_attributes_class # noqa: E501 + + delete a VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_volume_attributes_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttributesClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_volume_attributes_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttributesClass", + 202: "V1VolumeAttributesClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattributesclasses/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_csi_driver(self, **kwargs): # noqa: E501 + """list_csi_driver # noqa: E501 + + list or watch objects of kind CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_csi_driver(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSIDriverList + """ + kwargs['_return_http_data_only'] = True + return self.list_csi_driver_with_http_info(**kwargs) # noqa: E501 + + def list_csi_driver_with_http_info(self, **kwargs): # noqa: E501 + """list_csi_driver # noqa: E501 + + list or watch objects of kind CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_csi_driver_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSIDriverList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_csi_driver" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSIDriverList", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csidrivers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_csi_node(self, **kwargs): # noqa: E501 + """list_csi_node # noqa: E501 + + list or watch objects of kind CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_csi_node(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSINodeList + """ + kwargs['_return_http_data_only'] = True + return self.list_csi_node_with_http_info(**kwargs) # noqa: E501 + + def list_csi_node_with_http_info(self, **kwargs): # noqa: E501 + """list_csi_node # noqa: E501 + + list or watch objects of kind CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_csi_node_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSINodeList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_csi_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSINodeList", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csinodes', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_csi_storage_capacity_for_all_namespaces(self, **kwargs): # noqa: E501 + """list_csi_storage_capacity_for_all_namespaces # noqa: E501 + + list or watch objects of kind CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_csi_storage_capacity_for_all_namespaces(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSIStorageCapacityList + """ + kwargs['_return_http_data_only'] = True + return self.list_csi_storage_capacity_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 + + def list_csi_storage_capacity_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + """list_csi_storage_capacity_for_all_namespaces # noqa: E501 + + list or watch objects of kind CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_csi_storage_capacity_for_all_namespaces_with_http_info(async_req=True) + >>> result = thread.get() + + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSIStorageCapacityList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_csi_storage_capacity_for_all_namespaces" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSIStorageCapacityList", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csistoragecapacities', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_namespaced_csi_storage_capacity(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_csi_storage_capacity # noqa: E501 + + list or watch objects of kind CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_csi_storage_capacity(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSIStorageCapacityList + """ + kwargs['_return_http_data_only'] = True + return self.list_namespaced_csi_storage_capacity_with_http_info(namespace, **kwargs) # noqa: E501 + + def list_namespaced_csi_storage_capacity_with_http_info(self, namespace, **kwargs): # noqa: E501 + """list_namespaced_csi_storage_capacity # noqa: E501 + + list or watch objects of kind CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_namespaced_csi_storage_capacity_with_http_info(namespace, async_req=True) + >>> result = thread.get() + + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSIStorageCapacityList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_namespaced_csi_storage_capacity" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `list_namespaced_csi_storage_capacity`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'namespace' in local_var_params: + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSIStorageCapacityList", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_storage_class(self, **kwargs): # noqa: E501 + """list_storage_class # noqa: E501 + + list or watch objects of kind StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_storage_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StorageClassList + """ + kwargs['_return_http_data_only'] = True + return self.list_storage_class_with_http_info(**kwargs) # noqa: E501 + + def list_storage_class_with_http_info(self, **kwargs): # noqa: E501 + """list_storage_class # noqa: E501 + + list or watch objects of kind StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_storage_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StorageClassList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_storage_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StorageClassList", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/storageclasses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_volume_attachment(self, **kwargs): # noqa: E501 + """list_volume_attachment # noqa: E501 + + list or watch objects of kind VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_volume_attachment(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttachmentList + """ + kwargs['_return_http_data_only'] = True + return self.list_volume_attachment_with_http_info(**kwargs) # noqa: E501 + + def list_volume_attachment_with_http_info(self, **kwargs): # noqa: E501 + """list_volume_attachment # noqa: E501 + + list or watch objects of kind VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_volume_attachment_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttachmentList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_volume_attachment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttachmentList", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattachments', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_volume_attributes_class(self, **kwargs): # noqa: E501 + """list_volume_attributes_class # noqa: E501 + + list or watch objects of kind VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_volume_attributes_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttributesClassList + """ + kwargs['_return_http_data_only'] = True + return self.list_volume_attributes_class_with_http_info(**kwargs) # noqa: E501 + + def list_volume_attributes_class_with_http_info(self, **kwargs): # noqa: E501 + """list_volume_attributes_class # noqa: E501 + + list or watch objects of kind VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_volume_attributes_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttributesClassList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttributesClassList", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattributesclasses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_csi_driver(self, name, body, **kwargs): # noqa: E501 + """patch_csi_driver # noqa: E501 + + partially update the specified CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_csi_driver(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIDriver (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSIDriver + """ + kwargs['_return_http_data_only'] = True + return self.patch_csi_driver_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_csi_driver_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_csi_driver # noqa: E501 + + partially update the specified CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_csi_driver_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIDriver (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSIDriver, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_csi_driver" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_csi_driver`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_csi_driver`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSIDriver", + 201: "V1CSIDriver", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csidrivers/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_csi_node(self, name, body, **kwargs): # noqa: E501 + """patch_csi_node # noqa: E501 + + partially update the specified CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_csi_node(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CSINode (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSINode + """ + kwargs['_return_http_data_only'] = True + return self.patch_csi_node_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_csi_node_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_csi_node # noqa: E501 + + partially update the specified CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_csi_node_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CSINode (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSINode, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_csi_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_csi_node`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_csi_node`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSINode", + 201: "V1CSINode", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csinodes/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_namespaced_csi_storage_capacity(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_csi_storage_capacity # noqa: E501 + + partially update the specified CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_csi_storage_capacity(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIStorageCapacity (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSIStorageCapacity + """ + kwargs['_return_http_data_only'] = True + return self.patch_namespaced_csi_storage_capacity_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def patch_namespaced_csi_storage_capacity_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """patch_namespaced_csi_storage_capacity # noqa: E501 + + partially update the specified CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_namespaced_csi_storage_capacity_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIStorageCapacity (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSIStorageCapacity, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_namespaced_csi_storage_capacity" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_namespaced_csi_storage_capacity`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `patch_namespaced_csi_storage_capacity`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_namespaced_csi_storage_capacity`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSIStorageCapacity", + 201: "V1CSIStorageCapacity", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_storage_class(self, name, body, **kwargs): # noqa: E501 + """patch_storage_class # noqa: E501 + + partially update the specified StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_storage_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StorageClass + """ + kwargs['_return_http_data_only'] = True + return self.patch_storage_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_storage_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_storage_class # noqa: E501 + + partially update the specified StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_storage_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StorageClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_storage_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_storage_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_storage_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StorageClass", + 201: "V1StorageClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/storageclasses/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_volume_attachment(self, name, body, **kwargs): # noqa: E501 + """patch_volume_attachment # noqa: E501 + + partially update the specified VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_volume_attachment(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttachment + """ + kwargs['_return_http_data_only'] = True + return self.patch_volume_attachment_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_volume_attachment_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_volume_attachment # noqa: E501 + + partially update the specified VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_volume_attachment_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttachment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_volume_attachment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_volume_attachment`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_volume_attachment`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttachment", + 201: "V1VolumeAttachment", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattachments/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_volume_attachment_status(self, name, body, **kwargs): # noqa: E501 + """patch_volume_attachment_status # noqa: E501 + + partially update status of the specified VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_volume_attachment_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttachment + """ + kwargs['_return_http_data_only'] = True + return self.patch_volume_attachment_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_volume_attachment_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_volume_attachment_status # noqa: E501 + + partially update status of the specified VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_volume_attachment_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttachment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_volume_attachment_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_volume_attachment_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_volume_attachment_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttachment", + 201: "V1VolumeAttachment", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_volume_attributes_class(self, name, body, **kwargs): # noqa: E501 + """patch_volume_attributes_class # noqa: E501 + + partially update the specified VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_volume_attributes_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttributesClass + """ + kwargs['_return_http_data_only'] = True + return self.patch_volume_attributes_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_volume_attributes_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_volume_attributes_class # noqa: E501 + + partially update the specified VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_volume_attributes_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttributesClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_volume_attributes_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_volume_attributes_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttributesClass", + 201: "V1VolumeAttributesClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattributesclasses/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_csi_driver(self, name, **kwargs): # noqa: E501 + """read_csi_driver # noqa: E501 + + read the specified CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_csi_driver(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIDriver (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSIDriver + """ + kwargs['_return_http_data_only'] = True + return self.read_csi_driver_with_http_info(name, **kwargs) # noqa: E501 + + def read_csi_driver_with_http_info(self, name, **kwargs): # noqa: E501 + """read_csi_driver # noqa: E501 + + read the specified CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_csi_driver_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIDriver (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSIDriver, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_csi_driver" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_csi_driver`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSIDriver", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csidrivers/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_csi_node(self, name, **kwargs): # noqa: E501 + """read_csi_node # noqa: E501 + + read the specified CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_csi_node(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CSINode (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSINode + """ + kwargs['_return_http_data_only'] = True + return self.read_csi_node_with_http_info(name, **kwargs) # noqa: E501 + + def read_csi_node_with_http_info(self, name, **kwargs): # noqa: E501 + """read_csi_node # noqa: E501 + + read the specified CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_csi_node_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the CSINode (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSINode, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_csi_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_csi_node`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSINode", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csinodes/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_namespaced_csi_storage_capacity(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_csi_storage_capacity # noqa: E501 + + read the specified CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_csi_storage_capacity(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIStorageCapacity (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSIStorageCapacity + """ + kwargs['_return_http_data_only'] = True + return self.read_namespaced_csi_storage_capacity_with_http_info(name, namespace, **kwargs) # noqa: E501 + + def read_namespaced_csi_storage_capacity_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + """read_namespaced_csi_storage_capacity # noqa: E501 + + read the specified CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_namespaced_csi_storage_capacity_with_http_info(name, namespace, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIStorageCapacity (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSIStorageCapacity, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_namespaced_csi_storage_capacity" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_namespaced_csi_storage_capacity`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `read_namespaced_csi_storage_capacity`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSIStorageCapacity", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_storage_class(self, name, **kwargs): # noqa: E501 + """read_storage_class # noqa: E501 + + read the specified StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_storage_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StorageClass + """ + kwargs['_return_http_data_only'] = True + return self.read_storage_class_with_http_info(name, **kwargs) # noqa: E501 + + def read_storage_class_with_http_info(self, name, **kwargs): # noqa: E501 + """read_storage_class # noqa: E501 + + read the specified StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_storage_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StorageClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_storage_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_storage_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StorageClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/storageclasses/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_volume_attachment(self, name, **kwargs): # noqa: E501 + """read_volume_attachment # noqa: E501 + + read the specified VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_volume_attachment(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttachment + """ + kwargs['_return_http_data_only'] = True + return self.read_volume_attachment_with_http_info(name, **kwargs) # noqa: E501 + + def read_volume_attachment_with_http_info(self, name, **kwargs): # noqa: E501 + """read_volume_attachment # noqa: E501 + + read the specified VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_volume_attachment_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttachment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_volume_attachment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_volume_attachment`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttachment", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattachments/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_volume_attachment_status(self, name, **kwargs): # noqa: E501 + """read_volume_attachment_status # noqa: E501 + + read status of the specified VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_volume_attachment_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttachment + """ + kwargs['_return_http_data_only'] = True + return self.read_volume_attachment_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_volume_attachment_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_volume_attachment_status # noqa: E501 + + read status of the specified VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_volume_attachment_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttachment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_volume_attachment_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_volume_attachment_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttachment", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_volume_attributes_class(self, name, **kwargs): # noqa: E501 + """read_volume_attributes_class # noqa: E501 + + read the specified VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_volume_attributes_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttributesClass + """ + kwargs['_return_http_data_only'] = True + return self.read_volume_attributes_class_with_http_info(name, **kwargs) # noqa: E501 + + def read_volume_attributes_class_with_http_info(self, name, **kwargs): # noqa: E501 + """read_volume_attributes_class # noqa: E501 + + read the specified VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_volume_attributes_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttributesClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_volume_attributes_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttributesClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattributesclasses/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_csi_driver(self, name, body, **kwargs): # noqa: E501 + """replace_csi_driver # noqa: E501 + + replace the specified CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_csi_driver(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIDriver (required) + :type name: str + :param body: (required) + :type body: V1CSIDriver + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSIDriver + """ + kwargs['_return_http_data_only'] = True + return self.replace_csi_driver_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_csi_driver_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_csi_driver # noqa: E501 + + replace the specified CSIDriver # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_csi_driver_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIDriver (required) + :type name: str + :param body: (required) + :type body: V1CSIDriver + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSIDriver, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_csi_driver" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_csi_driver`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_csi_driver`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSIDriver", + 201: "V1CSIDriver", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csidrivers/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_csi_node(self, name, body, **kwargs): # noqa: E501 + """replace_csi_node # noqa: E501 + + replace the specified CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_csi_node(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CSINode (required) + :type name: str + :param body: (required) + :type body: V1CSINode + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSINode + """ + kwargs['_return_http_data_only'] = True + return self.replace_csi_node_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_csi_node_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_csi_node # noqa: E501 + + replace the specified CSINode # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_csi_node_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CSINode (required) + :type name: str + :param body: (required) + :type body: V1CSINode + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSINode, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_csi_node" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_csi_node`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_csi_node`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSINode", + 201: "V1CSINode", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/csinodes/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_namespaced_csi_storage_capacity(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_csi_storage_capacity # noqa: E501 + + replace the specified CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_csi_storage_capacity(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIStorageCapacity (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1CSIStorageCapacity + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1CSIStorageCapacity + """ + kwargs['_return_http_data_only'] = True + return self.replace_namespaced_csi_storage_capacity_with_http_info(name, namespace, body, **kwargs) # noqa: E501 + + def replace_namespaced_csi_storage_capacity_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + """replace_namespaced_csi_storage_capacity # noqa: E501 + + replace the specified CSIStorageCapacity # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_namespaced_csi_storage_capacity_with_http_info(name, namespace, body, async_req=True) + >>> result = thread.get() + + :param name: name of the CSIStorageCapacity (required) + :type name: str + :param namespace: object name and auth scope, such as for teams and projects (required) + :type namespace: str + :param body: (required) + :type body: V1CSIStorageCapacity + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1CSIStorageCapacity, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_namespaced_csi_storage_capacity" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_namespaced_csi_storage_capacity`") # noqa: E501 + # verify the required parameter 'namespace' is set + if self.api_client.client_side_validation and local_var_params.get('namespace') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `namespace` when calling `replace_namespaced_csi_storage_capacity`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_namespaced_csi_storage_capacity`") # noqa: E501 + + collection_formats = {} + + 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 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1CSIStorageCapacity", + 201: "V1CSIStorageCapacity", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_storage_class(self, name, body, **kwargs): # noqa: E501 + """replace_storage_class # noqa: E501 + + replace the specified StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_storage_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageClass (required) + :type name: str + :param body: (required) + :type body: V1StorageClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1StorageClass + """ + kwargs['_return_http_data_only'] = True + return self.replace_storage_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_storage_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_storage_class # noqa: E501 + + replace the specified StorageClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_storage_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageClass (required) + :type name: str + :param body: (required) + :type body: V1StorageClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1StorageClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_storage_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_storage_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_storage_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1StorageClass", + 201: "V1StorageClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/storageclasses/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_volume_attachment(self, name, body, **kwargs): # noqa: E501 + """replace_volume_attachment # noqa: E501 + + replace the specified VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_volume_attachment(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param body: (required) + :type body: V1VolumeAttachment + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttachment + """ + kwargs['_return_http_data_only'] = True + return self.replace_volume_attachment_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_volume_attachment_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_volume_attachment # noqa: E501 + + replace the specified VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_volume_attachment_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param body: (required) + :type body: V1VolumeAttachment + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttachment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_volume_attachment" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_volume_attachment`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_volume_attachment`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttachment", + 201: "V1VolumeAttachment", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattachments/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_volume_attachment_status(self, name, body, **kwargs): # noqa: E501 + """replace_volume_attachment_status # noqa: E501 + + replace status of the specified VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_volume_attachment_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param body: (required) + :type body: V1VolumeAttachment + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttachment + """ + kwargs['_return_http_data_only'] = True + return self.replace_volume_attachment_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_volume_attachment_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_volume_attachment_status # noqa: E501 + + replace status of the specified VolumeAttachment # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_volume_attachment_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttachment (required) + :type name: str + :param body: (required) + :type body: V1VolumeAttachment + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttachment, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_volume_attachment_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_volume_attachment_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_volume_attachment_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttachment", + 201: "V1VolumeAttachment", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_volume_attributes_class(self, name, body, **kwargs): # noqa: E501 + """replace_volume_attributes_class # noqa: E501 + + replace the specified VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_volume_attributes_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param body: (required) + :type body: V1VolumeAttributesClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1VolumeAttributesClass + """ + kwargs['_return_http_data_only'] = True + return self.replace_volume_attributes_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_volume_attributes_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_volume_attributes_class # noqa: E501 + + replace the specified VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_volume_attributes_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param body: (required) + :type body: V1VolumeAttributesClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1VolumeAttributesClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_volume_attributes_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_volume_attributes_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1VolumeAttributesClass", + 201: "V1VolumeAttributesClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1/volumeattributesclasses/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/storage_v1beta1_api.py b/kubernetes_asyncio/client/api/storage_v1beta1_api.py new file mode 100644 index 0000000000..bdd9a0163c --- /dev/null +++ b/kubernetes_asyncio/client/api/storage_v1beta1_api.py @@ -0,0 +1,1473 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class StorageV1beta1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_volume_attributes_class(self, body, **kwargs): # noqa: E501 + """create_volume_attributes_class # noqa: E501 + + create a VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_volume_attributes_class(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1VolumeAttributesClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1VolumeAttributesClass + """ + kwargs['_return_http_data_only'] = True + return self.create_volume_attributes_class_with_http_info(body, **kwargs) # noqa: E501 + + def create_volume_attributes_class_with_http_info(self, body, **kwargs): # noqa: E501 + """create_volume_attributes_class # noqa: E501 + + create a VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_volume_attributes_class_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1VolumeAttributesClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1VolumeAttributesClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_volume_attributes_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1VolumeAttributesClass", + 201: "V1beta1VolumeAttributesClass", + 202: "V1beta1VolumeAttributesClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1beta1/volumeattributesclasses', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_volume_attributes_class(self, **kwargs): # noqa: E501 + """delete_collection_volume_attributes_class # noqa: E501 + + delete collection of VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_volume_attributes_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_volume_attributes_class_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_volume_attributes_class_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_volume_attributes_class # noqa: E501 + + delete collection of VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_volume_attributes_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1beta1/volumeattributesclasses', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_volume_attributes_class(self, name, **kwargs): # noqa: E501 + """delete_volume_attributes_class # noqa: E501 + + delete a VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_volume_attributes_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1VolumeAttributesClass + """ + kwargs['_return_http_data_only'] = True + return self.delete_volume_attributes_class_with_http_info(name, **kwargs) # noqa: E501 + + def delete_volume_attributes_class_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_volume_attributes_class # noqa: E501 + + delete a VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_volume_attributes_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1VolumeAttributesClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_volume_attributes_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1VolumeAttributesClass", + 202: "V1beta1VolumeAttributesClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1beta1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_volume_attributes_class(self, **kwargs): # noqa: E501 + """list_volume_attributes_class # noqa: E501 + + list or watch objects of kind VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_volume_attributes_class(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1VolumeAttributesClassList + """ + kwargs['_return_http_data_only'] = True + return self.list_volume_attributes_class_with_http_info(**kwargs) # noqa: E501 + + def list_volume_attributes_class_with_http_info(self, **kwargs): # noqa: E501 + """list_volume_attributes_class # noqa: E501 + + list or watch objects of kind VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_volume_attributes_class_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1VolumeAttributesClassList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1VolumeAttributesClassList", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1beta1/volumeattributesclasses', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_volume_attributes_class(self, name, body, **kwargs): # noqa: E501 + """patch_volume_attributes_class # noqa: E501 + + partially update the specified VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_volume_attributes_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1VolumeAttributesClass + """ + kwargs['_return_http_data_only'] = True + return self.patch_volume_attributes_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_volume_attributes_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_volume_attributes_class # noqa: E501 + + partially update the specified VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_volume_attributes_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1VolumeAttributesClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_volume_attributes_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_volume_attributes_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1VolumeAttributesClass", + 201: "V1beta1VolumeAttributesClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_volume_attributes_class(self, name, **kwargs): # noqa: E501 + """read_volume_attributes_class # noqa: E501 + + read the specified VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_volume_attributes_class(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1VolumeAttributesClass + """ + kwargs['_return_http_data_only'] = True + return self.read_volume_attributes_class_with_http_info(name, **kwargs) # noqa: E501 + + def read_volume_attributes_class_with_http_info(self, name, **kwargs): # noqa: E501 + """read_volume_attributes_class # noqa: E501 + + read the specified VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_volume_attributes_class_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1VolumeAttributesClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_volume_attributes_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1VolumeAttributesClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_volume_attributes_class(self, name, body, **kwargs): # noqa: E501 + """replace_volume_attributes_class # noqa: E501 + + replace the specified VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_volume_attributes_class(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param body: (required) + :type body: V1beta1VolumeAttributesClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1VolumeAttributesClass + """ + kwargs['_return_http_data_only'] = True + return self.replace_volume_attributes_class_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_volume_attributes_class_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_volume_attributes_class # noqa: E501 + + replace the specified VolumeAttributesClass # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_volume_attributes_class_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the VolumeAttributesClass (required) + :type name: str + :param body: (required) + :type body: V1beta1VolumeAttributesClass + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1VolumeAttributesClass, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_volume_attributes_class" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_volume_attributes_class`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_volume_attributes_class`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1VolumeAttributesClass", + 201: "V1beta1VolumeAttributesClass", + 401: None, + } + + return self.api_client.call_api( + '/apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/storagemigration_api.py b/kubernetes_asyncio/client/api/storagemigration_api.py new file mode 100644 index 0000000000..9339c9663f --- /dev/null +++ b/kubernetes_asyncio/client/api/storagemigration_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class StoragemigrationApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_api_group(self, **kwargs): # noqa: E501 + """get_api_group # noqa: E501 + + get information of a group # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIGroup + """ + kwargs['_return_http_data_only'] = True + return self.get_api_group_with_http_info(**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 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_group_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIGroup, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_group" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIGroup", + 401: None, + } + + return self.api_client.call_api( + '/apis/storagemigration.k8s.io/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/storagemigration_v1beta1_api.py b/kubernetes_asyncio/client/api/storagemigration_v1beta1_api.py new file mode 100644 index 0000000000..4e8e16b97e --- /dev/null +++ b/kubernetes_asyncio/client/api/storagemigration_v1beta1_api.py @@ -0,0 +1,1987 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class StoragemigrationV1beta1Api(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def create_storage_version_migration(self, body, **kwargs): # noqa: E501 + """create_storage_version_migration # noqa: E501 + + create a StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_storage_version_migration(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1StorageVersionMigration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1StorageVersionMigration + """ + kwargs['_return_http_data_only'] = True + return self.create_storage_version_migration_with_http_info(body, **kwargs) # noqa: E501 + + def create_storage_version_migration_with_http_info(self, body, **kwargs): # noqa: E501 + """create_storage_version_migration # noqa: E501 + + create a StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_storage_version_migration_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param body: (required) + :type body: V1beta1StorageVersionMigration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1StorageVersionMigration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method create_storage_version_migration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `create_storage_version_migration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1StorageVersionMigration", + 201: "V1beta1StorageVersionMigration", + 202: "V1beta1StorageVersionMigration", + 401: None, + } + + return self.api_client.call_api( + '/apis/storagemigration.k8s.io/v1beta1/storageversionmigrations', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_collection_storage_version_migration(self, **kwargs): # noqa: E501 + """delete_collection_storage_version_migration # noqa: E501 + + delete collection of StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_storage_version_migration(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_collection_storage_version_migration_with_http_info(**kwargs) # noqa: E501 + + def delete_collection_storage_version_migration_with_http_info(self, **kwargs): # noqa: E501 + """delete_collection_storage_version_migration # noqa: E501 + + delete collection of StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_collection_storage_version_migration_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_collection_storage_version_migration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/storagemigration.k8s.io/v1beta1/storageversionmigrations', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def delete_storage_version_migration(self, name, **kwargs): # noqa: E501 + """delete_storage_version_migration # noqa: E501 + + delete a StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_storage_version_migration(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1Status + """ + kwargs['_return_http_data_only'] = True + return self.delete_storage_version_migration_with_http_info(name, **kwargs) # noqa: E501 + + def delete_storage_version_migration_with_http_info(self, name, **kwargs): # noqa: E501 + """delete_storage_version_migration # noqa: E501 + + delete a StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_storage_version_migration_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. + :type grace_period_seconds: int + :param ignore_store_read_error_with_cluster_breaking_potential: if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it + :type ignore_store_read_error_with_cluster_breaking_potential: bool + :param orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. + :type orphan_dependents: bool + :param propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. + :type propagation_policy: str + :param body: + :type body: V1DeleteOptions + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1Status, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'ignore_store_read_error_with_cluster_breaking_potential', + 'orphan_dependents', + 'propagation_policy', + 'body' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_storage_version_migration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `delete_storage_version_migration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('grace_period_seconds') is not None: # noqa: E501 + query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501 + if local_var_params.get('ignore_store_read_error_with_cluster_breaking_potential') is not None: # noqa: E501 + query_params.append(('ignoreStoreReadErrorWithClusterBreakingPotential', local_var_params['ignore_store_read_error_with_cluster_breaking_potential'])) # noqa: E501 + if local_var_params.get('orphan_dependents') is not None: # noqa: E501 + query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501 + if local_var_params.get('propagation_policy') is not None: # noqa: E501 + query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1Status", + 202: "V1Status", + 401: None, + } + + return self.api_client.call_api( + '/apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def get_api_resources(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1APIResourceList + """ + kwargs['_return_http_data_only'] = True + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 + + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + """get_api_resources # noqa: E501 + + get available resources # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_api_resources_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1APIResourceList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_api_resources" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1APIResourceList", + 401: None, + } + + return self.api_client.call_api( + '/apis/storagemigration.k8s.io/v1beta1/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def list_storage_version_migration(self, **kwargs): # noqa: E501 + """list_storage_version_migration # noqa: E501 + + list or watch objects of kind StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_storage_version_migration(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1StorageVersionMigrationList + """ + kwargs['_return_http_data_only'] = True + return self.list_storage_version_migration_with_http_info(**kwargs) # noqa: E501 + + def list_storage_version_migration_with_http_info(self, **kwargs): # noqa: E501 + """list_storage_version_migration # noqa: E501 + + list or watch objects of kind StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_storage_version_migration_with_http_info(async_req=True) + >>> result = thread.get() + + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param allow_watch_bookmarks: allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. + :type allow_watch_bookmarks: bool + :param _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. + :type _continue: str + :param field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything. + :type field_selector: str + :param label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything. + :type label_selector: str + :param limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. + :type limit: int + :param resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version: str + :param resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset + :type resource_version_match: str + :param send_initial_events: `sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched. When `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan is interpreted as \"data at least as new as the provided `resourceVersion`\" and the bookmark event is send when the state is synced to a `resourceVersion` at least as fresh as the one provided by the ListOptions. If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the bookmark event is send when the state is synced at least to the moment when request started being processed. - `resourceVersionMatch` set to any other value or unset Invalid error is returned. Defaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise. + :type send_initial_events: bool + :param timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. + :type timeout_seconds: int + :param watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. + :type watch: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1StorageVersionMigrationList, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'resource_version_match', + 'send_initial_events', + 'timeout_seconds', + 'watch' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method list_storage_version_migration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('allow_watch_bookmarks') is not None: # noqa: E501 + query_params.append(('allowWatchBookmarks', local_var_params['allow_watch_bookmarks'])) # noqa: E501 + if local_var_params.get('_continue') is not None: # noqa: E501 + query_params.append(('continue', local_var_params['_continue'])) # noqa: E501 + if local_var_params.get('field_selector') is not None: # noqa: E501 + query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501 + if local_var_params.get('label_selector') is not None: # noqa: E501 + query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501 + if local_var_params.get('limit') is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + if local_var_params.get('resource_version') is not None: # noqa: E501 + query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501 + if local_var_params.get('resource_version_match') is not None: # noqa: E501 + query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501 + if local_var_params.get('send_initial_events') is not None: # noqa: E501 + query_params.append(('sendInitialEvents', local_var_params['send_initial_events'])) # noqa: E501 + if local_var_params.get('timeout_seconds') is not None: # noqa: E501 + query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501 + if local_var_params.get('watch') is not None: # noqa: E501 + query_params.append(('watch', local_var_params['watch'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch', 'application/cbor-seq']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1StorageVersionMigrationList", + 401: None, + } + + return self.api_client.call_api( + '/apis/storagemigration.k8s.io/v1beta1/storageversionmigrations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_storage_version_migration(self, name, body, **kwargs): # noqa: E501 + """patch_storage_version_migration # noqa: E501 + + partially update the specified StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_storage_version_migration(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1StorageVersionMigration + """ + kwargs['_return_http_data_only'] = True + return self.patch_storage_version_migration_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_storage_version_migration_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_storage_version_migration # noqa: E501 + + partially update the specified StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_storage_version_migration_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1StorageVersionMigration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_storage_version_migration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_storage_version_migration`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_storage_version_migration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1StorageVersionMigration", + 201: "V1beta1StorageVersionMigration", + 401: None, + } + + return self.api_client.call_api( + '/apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def patch_storage_version_migration_status(self, name, body, **kwargs): # noqa: E501 + """patch_storage_version_migration_status # noqa: E501 + + partially update status of the specified StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_storage_version_migration_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1StorageVersionMigration + """ + kwargs['_return_http_data_only'] = True + return self.patch_storage_version_migration_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def patch_storage_version_migration_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """patch_storage_version_migration_status # noqa: E501 + + partially update status of the specified StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_storage_version_migration_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param body: (required) + :type body: object + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch). + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. + :type force: bool + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1StorageVersionMigration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation', + 'force' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method patch_storage_version_migration_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `patch_storage_version_migration_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `patch_storage_version_migration_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + if local_var_params.get('force') is not None: # noqa: E501 + query_params.append(('force', local_var_params['force'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # HTTP header `Content-Type` + content_types_list = local_var_params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml', 'application/apply-patch+cbor'], + 'PATCH', body_params)) # noqa: E501 + if content_types_list: + header_params['Content-Type'] = content_types_list + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1StorageVersionMigration", + 201: "V1beta1StorageVersionMigration", + 401: None, + } + + return self.api_client.call_api( + '/apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name}/status', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_storage_version_migration(self, name, **kwargs): # noqa: E501 + """read_storage_version_migration # noqa: E501 + + read the specified StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_storage_version_migration(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1StorageVersionMigration + """ + kwargs['_return_http_data_only'] = True + return self.read_storage_version_migration_with_http_info(name, **kwargs) # noqa: E501 + + def read_storage_version_migration_with_http_info(self, name, **kwargs): # noqa: E501 + """read_storage_version_migration # noqa: E501 + + read the specified StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_storage_version_migration_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1StorageVersionMigration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_storage_version_migration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_storage_version_migration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1StorageVersionMigration", + 401: None, + } + + return self.api_client.call_api( + '/apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def read_storage_version_migration_status(self, name, **kwargs): # noqa: E501 + """read_storage_version_migration_status # noqa: E501 + + read status of the specified StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_storage_version_migration_status(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1StorageVersionMigration + """ + kwargs['_return_http_data_only'] = True + return self.read_storage_version_migration_status_with_http_info(name, **kwargs) # noqa: E501 + + def read_storage_version_migration_status_with_http_info(self, name, **kwargs): # noqa: E501 + """read_storage_version_migration_status # noqa: E501 + + read status of the specified StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.read_storage_version_migration_status_with_http_info(name, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1StorageVersionMigration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'pretty' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method read_storage_version_migration_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `read_storage_version_migration_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1StorageVersionMigration", + 401: None, + } + + return self.api_client.call_api( + '/apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_storage_version_migration(self, name, body, **kwargs): # noqa: E501 + """replace_storage_version_migration # noqa: E501 + + replace the specified StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_storage_version_migration(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param body: (required) + :type body: V1beta1StorageVersionMigration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1StorageVersionMigration + """ + kwargs['_return_http_data_only'] = True + return self.replace_storage_version_migration_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_storage_version_migration_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_storage_version_migration # noqa: E501 + + replace the specified StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_storage_version_migration_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param body: (required) + :type body: V1beta1StorageVersionMigration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1StorageVersionMigration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_storage_version_migration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_storage_version_migration`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_storage_version_migration`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1StorageVersionMigration", + 201: "V1beta1StorageVersionMigration", + 401: None, + } + + return self.api_client.call_api( + '/apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) + + def replace_storage_version_migration_status(self, name, body, **kwargs): # noqa: E501 + """replace_storage_version_migration_status # noqa: E501 + + replace status of the specified StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_storage_version_migration_status(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param body: (required) + :type body: V1beta1StorageVersionMigration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: V1beta1StorageVersionMigration + """ + kwargs['_return_http_data_only'] = True + return self.replace_storage_version_migration_status_with_http_info(name, body, **kwargs) # noqa: E501 + + def replace_storage_version_migration_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + """replace_storage_version_migration_status # noqa: E501 + + replace status of the specified StorageVersionMigration # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.replace_storage_version_migration_status_with_http_info(name, body, async_req=True) + >>> result = thread.get() + + :param name: name of the StorageVersionMigration (required) + :type name: str + :param body: (required) + :type body: V1beta1StorageVersionMigration + :param pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). + :type pretty: str + :param dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed + :type dry_run: str + :param field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. + :type field_manager: str + :param field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. + :type field_validation: str + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(V1beta1StorageVersionMigration, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'field_validation' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method replace_storage_version_migration_status" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'name' is set + if self.api_client.client_side_validation and local_var_params.get('name') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `name` when calling `replace_storage_version_migration_status`") # noqa: E501 + # verify the required parameter 'body' is set + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 + raise ApiValueError("Missing the required parameter `body` when calling `replace_storage_version_migration_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'name' in local_var_params: + path_params['name'] = local_var_params['name'] # noqa: E501 + + query_params = [] + if local_var_params.get('pretty') is not None: # noqa: E501 + query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 + if local_var_params.get('dry_run') is not None: # noqa: E501 + query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501 + if local_var_params.get('field_manager') is not None: # noqa: E501 + query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 + if local_var_params.get('field_validation') is not None: # noqa: E501 + query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501 + + header_params = dict(local_var_params.get('_headers', {})) + + 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', 'application/cbor']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "V1beta1StorageVersionMigration", + 201: "V1beta1StorageVersionMigration", + 401: None, + } + + return self.api_client.call_api( + '/apis/storagemigration.k8s.io/v1beta1/storageversionmigrations/{name}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/version_api.py b/kubernetes_asyncio/client/api/version_api.py new file mode 100644 index 0000000000..a872e1547a --- /dev/null +++ b/kubernetes_asyncio/client/api/version_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class VersionApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_code(self, **kwargs): # noqa: E501 + """get_code # noqa: E501 + + get the version information for this server # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_code(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: VersionInfo + """ + kwargs['_return_http_data_only'] = True + return self.get_code_with_http_info(**kwargs) # noqa: E501 + + def get_code_with_http_info(self, **kwargs): # noqa: E501 + """get_code # noqa: E501 + + get the version information for this server # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_code_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(VersionInfo, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_code" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "VersionInfo", + 401: None, + } + + return self.api_client.call_api( + '/version/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api/well_known_api.py b/kubernetes_asyncio/client/api/well_known_api.py new file mode 100644 index 0000000000..d448d8664e --- /dev/null +++ b/kubernetes_asyncio/client/api/well_known_api.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from kubernetes_asyncio.client.api_client import ApiClient +from kubernetes_asyncio.client.exceptions import ( # noqa: F401 + ApiTypeError, + ApiValueError +) + + +class WellKnownApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_service_account_issuer_open_id_configuration(self, **kwargs): # noqa: E501 + """get_service_account_issuer_open_id_configuration # noqa: E501 + + get service account issuer OpenID configuration, also known as the 'OIDC discovery doc' # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_service_account_issuer_open_id_configuration(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: str + """ + kwargs['_return_http_data_only'] = True + return self.get_service_account_issuer_open_id_configuration_with_http_info(**kwargs) # noqa: E501 + + def get_service_account_issuer_open_id_configuration_with_http_info(self, **kwargs): # noqa: E501 + """get_service_account_issuer_open_id_configuration # noqa: E501 + + get service account issuer OpenID configuration, also known as the 'OIDC discovery doc' # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_service_account_issuer_open_id_configuration_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional + :type _content_type: string, optional: force content-type for the request + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) + """ + + local_var_params = locals() + + all_params = [ + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method get_service_account_issuer_open_id_configuration" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = dict(local_var_params.get('_headers', {})) + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['BearerToken'] # noqa: E501 + + response_types_map = { + 200: "str", + 401: None, + } + + return self.api_client.call_api( + '/.well-known/openid-configuration', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_types_map=response_types_map, + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + _request_auth=local_var_params.get('_request_auth')) diff --git a/kubernetes_asyncio/client/api_client.py b/kubernetes_asyncio/client/api_client.py new file mode 100644 index 0000000000..5f8ebcea8b --- /dev/null +++ b/kubernetes_asyncio/client/api_client.py @@ -0,0 +1,707 @@ +# coding: utf-8 +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + +from __future__ import absolute_import + +import atexit +import datetime +from dateutil.parser import parse +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from kubernetes_asyncio.client.configuration import Configuration +import kubernetes_asyncio.client.models +from kubernetes_asyncio.client import rest +from kubernetes_asyncio.client.exceptions import ApiValueError, ApiException + + +class ApiClient(object): + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration.get_default_copy() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/35.0.0+snapshot/python' + self.client_side_validation = configuration.client_side_validation + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_value, traceback): + await self.close() + + async def close(self): + await self.rest_client.close() + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + atexit.register(self.close) + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + async def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_types_map=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None, + _request_auth=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + post_params.extend(self.files_parameters(files)) + + # auth setting + await self.update_params_for_auth( + header_params, query_params, auth_settings, + request_auth=_request_auth) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + try: + # perform request and return response + response_data = await self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + except ApiException as e: + e.body = e.body.decode('utf-8') if six.PY3 else e.body + raise e + + self.last_response = response_data + + return_data = response_data + + if not _preload_content: + return return_data + + response_type = None + if response_types_map: + response_type = response_types_map.get(response_data.status, None) + + if six.PY3 and response_type not in ["file", "bytes"]: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_data.data = response_data.data.decode(encoding) + + # deserialize response data + + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.openapi_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(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) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(kubernetes_asyncio.client.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_types_map=None, auth_settings=None, + async_req=None, _return_http_data_only=None, + collection_formats=None,_preload_content=True, + _request_timeout=None, _host=None, _request_auth=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_token: dict, optional + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_types_map, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host, + _request_auth) + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, + query_params, + header_params, body, + post_params, files, + response_types_map, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, _request_auth)) + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types, method=None, body=None): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + content_types = [x.lower() for x in content_types] + + if method == 'PATCH': + if ('application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if ('application/strategic-merge-patch+json' in content_types and + (isinstance(body, dict) or hasattr(body, "to_dict"))): + return 'application/strategic-merge-patch+json' + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + async def update_params_for_auth(self, headers, queries, auth_settings, + request_auth=None): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params(headers, queries, request_auth) + return + + for auth in auth_settings: + auth_setting = (await self.configuration.auth_settings()).get(auth) + if auth_setting: + self._apply_auth_params(headers, queries, auth_setting) + + def _apply_auth_params(self, headers, queries, auth_setting): + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + 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) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + has_discriminator = False + if (hasattr(klass, 'get_real_child_model') + and klass.discriminator_value_class_map): + has_discriminator = True + + if not klass.openapi_types and has_discriminator is False: + return data + + kwargs = {} + if (data is not None and + klass.openapi_types is not None and + isinstance(data, (list, dict))): + for attr, attr_type in six.iteritems(klass.openapi_types): + if klass.attribute_map[attr] in data: + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + kwargs["local_vars_configuration"] = self.configuration + instance = klass(**kwargs) + + if has_discriminator: + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/kubernetes_asyncio/client/api_client.py.orig b/kubernetes_asyncio/client/api_client.py.orig new file mode 100644 index 0000000000..d7a8cb77a5 --- /dev/null +++ b/kubernetes_asyncio/client/api_client.py.orig @@ -0,0 +1,707 @@ +# coding: utf-8 +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + +from __future__ import absolute_import + +import atexit +import datetime +from dateutil.parser import parse +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from kubernetes_asyncio.client.configuration import Configuration +import kubernetes_asyncio.client.models +from kubernetes_asyncio.client import rest +from kubernetes_asyncio.client.exceptions import ApiValueError, ApiException + + +class ApiClient(object): + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration.get_default_copy() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/35.0.0+snapshot/python' + self.client_side_validation = configuration.client_side_validation + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_value, traceback): + await self.close() + + async def close(self): + await self.rest_client.close() + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + atexit.register(self.close) + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + async def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_types_map=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None, _host=None, + _request_auth=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, query_params, auth_settings, + request_auth=_request_auth) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + try: + # perform request and return response + response_data = await self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + except ApiException as e: + e.body = e.body.decode('utf-8') if six.PY3 else e.body + raise e + + self.last_response = response_data + + return_data = response_data + + if not _preload_content: + return return_data + + response_type = None + if response_types_map: + response_type = response_types_map.get(response_data.status, None) + + if six.PY3 and response_type not in ["file", "bytes"]: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_data.data = response_data.data.decode(encoding) + + # deserialize response data + + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.openapi_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(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) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(kubernetes_asyncio.client.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_types_map=None, auth_settings=None, + async_req=None, _return_http_data_only=None, + collection_formats=None,_preload_content=True, + _request_timeout=None, _host=None, _request_auth=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_token: dict, optional + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_types_map, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host, + _request_auth) + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, + query_params, + header_params, body, + post_params, files, + response_types_map, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, _request_auth)) + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def files_parameters(self, files=None): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types, method=None, body=None): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + content_types = [x.lower() for x in content_types] + + if method == 'PATCH': + if ('application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if ('application/strategic-merge-patch+json' in content_types and + (isinstance(body, dict) or hasattr(body, "to_dict"))): + return 'application/strategic-merge-patch+json' + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, queries, auth_settings, + request_auth=None): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params(headers, queries, request_auth) + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params(headers, queries, auth_setting) + + def _apply_auth_params(self, headers, queries, auth_setting): + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + 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) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + has_discriminator = False + if (hasattr(klass, 'get_real_child_model') + and klass.discriminator_value_class_map): + has_discriminator = True + + if not klass.openapi_types and has_discriminator is False: + return data + + kwargs = {} + if (data is not None and + klass.openapi_types is not None and + isinstance(data, (list, dict))): + for attr, attr_type in six.iteritems(klass.openapi_types): + if klass.attribute_map[attr] in data: + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + kwargs["local_vars_configuration"] = self.configuration + instance = klass(**kwargs) + + if has_discriminator: + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/kubernetes_asyncio/client/configuration.py b/kubernetes_asyncio/client/configuration.py new file mode 100644 index 0000000000..2bb75f66eb --- /dev/null +++ b/kubernetes_asyncio/client/configuration.py @@ -0,0 +1,501 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import asyncio +import copy +import logging +import sys +import urllib3 + +import six +from six.moves import http_client as httplib +from kubernetes_asyncio.client.exceptions import ApiValueError + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param discard_unknown_keys: Boolean value indicating whether to discard + unknown properties. A server may send a response that includes additional + properties that are not known by the client in the following scenarios: + 1. The OpenAPI document is incomplete, i.e. it does not match the server + implementation. + 2. The client was generated using an older version of the OpenAPI document + and the server has been upgraded since then. + If a schema in the OpenAPI document defines the additionalProperties attribute, + then all undeclared properties received by the server are injected into the + additional properties map. In that case, there are undeclared properties, and + nothing to discard. + :param disabled_client_side_validations (string): Comma-separated list of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_client_side_validations is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = client.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + discard_unknown_keys=False, + disabled_client_side_validations="", + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ssl_ca_cert=None, + ): + """Constructor + """ + self._base_path = "http://localhost" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.discard_unknown_keys = discard_unknown_keys + self.disabled_client_side_validations = disabled_client_side_validations + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("client") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.disable_strict_ssl_verification = False + """Set to true, to accept certificates violate X509 strict certificate + verification requirements, like missing the following extensions: + - X509v3 Subject Key Identifier + - X509v3 Authority Key Identifier + - X509v3 Subject Alternative Name + (It is implemented by removing ssl.VERIFY_X509_STRICT from SSLContext.verify_flags) + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by Kubernetes API. + """ + + self.connection_pool_maxsize = 100 + """This value is passed to the aiohttp to limit simultaneous connections. + Default values is 100, None means no-limit. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + if name == 'disabled_client_side_validations': + s = set(filter(None, value.split(','))) + for v in s: + if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: + raise ApiValueError( + "Invalid keyword: '{0}''".format(v)) + self._disabled_client_side_validations = s + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = copy.deepcopy(default) + + @classmethod + def get_default(cls): + """Get default instance of configuration. + + :return: The Configuration object. + """ + if cls._default is None: + cls.set_default(Configuration()) + return cls._default + + @classmethod + def get_default_copy(cls): + """Return new instance of configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration passed by the set_default method. + + :return: The configuration object. + """ + if cls._default is not None: + return copy.deepcopy(cls._default) + return Configuration() + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + async def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + result = self.refresh_api_key_hook(self) + if asyncio.iscoroutine(result): + await result + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + async def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if 'BearerToken' in self.api_key: + auth['BearerToken'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'authorization', + 'value': await self.get_api_key_with_prefix( + 'BearerToken', + ), + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: release-1.35\n"\ + "SDK Package Version: 35.0.0+snapshot".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "", + 'description': "No description provided", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/kubernetes_asyncio/client/configuration.py.orig b/kubernetes_asyncio/client/configuration.py.orig new file mode 100644 index 0000000000..03fa6d0c02 --- /dev/null +++ b/kubernetes_asyncio/client/configuration.py.orig @@ -0,0 +1,498 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import copy +import logging +import sys +import urllib3 + +import six +from six.moves import http_client as httplib +from kubernetes_asyncio.client.exceptions import ApiValueError + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +class Configuration(object): + """NOTE: This class is auto generated by OpenAPI Generator + + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param discard_unknown_keys: Boolean value indicating whether to discard + unknown properties. A server may send a response that includes additional + properties that are not known by the client in the following scenarios: + 1. The OpenAPI document is incomplete, i.e. it does not match the server + implementation. + 2. The client was generated using an older version of the OpenAPI document + and the server has been upgraded since then. + If a schema in the OpenAPI document defines the additionalProperties attribute, + then all undeclared properties received by the server are injected into the + additional properties map. In that case, there are undeclared properties, and + nothing to discard. + :param disabled_client_side_validations (string): Comma-separated list of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_client_side_validations is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = client.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + username=None, password=None, + discard_unknown_keys=False, + disabled_client_side_validations="", + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ssl_ca_cert=None, + ): + """Constructor + """ + self._base_path = "http://localhost" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.discard_unknown_keys = discard_unknown_keys + self.disabled_client_side_validations = disabled_client_side_validations + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("client") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.disable_strict_ssl_verification = False + """Set to true, to accept certificates violate X509 strict certificate + verification requirements, like missing the following extensions: + - X509v3 Subject Key Identifier + - X509v3 Authority Key Identifier + - X509v3 Subject Alternative Name + (It is implemented by removing ssl.VERIFY_X509_STRICT from SSLContext.verify_flags) + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by Kubernetes API. + """ + + self.connection_pool_maxsize = 100 + """This value is passed to the aiohttp to limit simultaneous connections. + Default values is 100, None means no-limit. + """ + + self.proxy = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + if name == 'disabled_client_side_validations': + s = set(filter(None, value.split(','))) + for v in s: + if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: + raise ApiValueError( + "Invalid keyword: '{0}''".format(v)) + self._disabled_client_side_validations = s + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = copy.deepcopy(default) + + @classmethod + def get_default(cls): + """Get default instance of configuration. + + :return: The Configuration object. + """ + if cls._default is None: + cls.set_default(Configuration()) + return cls._default + + @classmethod + def get_default_copy(cls): + """Return new instance of configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration passed by the set_default method. + + :return: The configuration object. + """ + if cls._default is not None: + return copy.deepcopy(cls._default) + return Configuration() + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if 'BearerToken' in self.api_key: + auth['BearerToken'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'authorization', + 'value': self.get_api_key_with_prefix( + 'BearerToken', + ), + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: release-1.35\n"\ + "SDK Package Version: 35.0.0+snapshot".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "", + 'description': "No description provided", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/kubernetes_asyncio/client/exceptions.py b/kubernetes_asyncio/client/exceptions.py new file mode 100644 index 0000000000..d68d48c6b4 --- /dev/null +++ b/kubernetes_asyncio/client/exceptions.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +import six + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None): + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +class NotFoundException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(NotFoundException, self).__init__(status, reason, http_resp) + + +class UnauthorizedException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(UnauthorizedException, self).__init__(status, reason, http_resp) + + +class ForbiddenException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(ForbiddenException, self).__init__(status, reason, http_resp) + + +class ServiceException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(ServiceException, self).__init__(status, reason, http_resp) + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, six.integer_types): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/kubernetes_asyncio/client/models/__init__.py b/kubernetes_asyncio/client/models/__init__.py new file mode 100644 index 0000000000..222af08245 --- /dev/null +++ b/kubernetes_asyncio/client/models/__init__.py @@ -0,0 +1,747 @@ +# coding: utf-8 + +# flake8: noqa +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +# import models into model package +from kubernetes_asyncio.client.models.admissionregistration_v1_service_reference import AdmissionregistrationV1ServiceReference +from kubernetes_asyncio.client.models.admissionregistration_v1_webhook_client_config import AdmissionregistrationV1WebhookClientConfig +from kubernetes_asyncio.client.models.apiextensions_v1_service_reference import ApiextensionsV1ServiceReference +from kubernetes_asyncio.client.models.apiextensions_v1_webhook_client_config import ApiextensionsV1WebhookClientConfig +from kubernetes_asyncio.client.models.apiregistration_v1_service_reference import ApiregistrationV1ServiceReference +from kubernetes_asyncio.client.models.authentication_v1_token_request import AuthenticationV1TokenRequest +from kubernetes_asyncio.client.models.core_v1_endpoint_port import CoreV1EndpointPort +from kubernetes_asyncio.client.models.core_v1_event import CoreV1Event +from kubernetes_asyncio.client.models.core_v1_event_list import CoreV1EventList +from kubernetes_asyncio.client.models.core_v1_event_series import CoreV1EventSeries +from kubernetes_asyncio.client.models.core_v1_resource_claim import CoreV1ResourceClaim +from kubernetes_asyncio.client.models.discovery_v1_endpoint_port import DiscoveryV1EndpointPort +from kubernetes_asyncio.client.models.events_v1_event import EventsV1Event +from kubernetes_asyncio.client.models.events_v1_event_list import EventsV1EventList +from kubernetes_asyncio.client.models.events_v1_event_series import EventsV1EventSeries +from kubernetes_asyncio.client.models.flowcontrol_v1_subject import FlowcontrolV1Subject +from kubernetes_asyncio.client.models.rbac_v1_subject import RbacV1Subject +from kubernetes_asyncio.client.models.resource_v1_resource_claim import ResourceV1ResourceClaim +from kubernetes_asyncio.client.models.storage_v1_token_request import StorageV1TokenRequest +from kubernetes_asyncio.client.models.v1_api_group import V1APIGroup +from kubernetes_asyncio.client.models.v1_api_group_list import V1APIGroupList +from kubernetes_asyncio.client.models.v1_api_resource import V1APIResource +from kubernetes_asyncio.client.models.v1_api_resource_list import V1APIResourceList +from kubernetes_asyncio.client.models.v1_api_service import V1APIService +from kubernetes_asyncio.client.models.v1_api_service_condition import V1APIServiceCondition +from kubernetes_asyncio.client.models.v1_api_service_list import V1APIServiceList +from kubernetes_asyncio.client.models.v1_api_service_spec import V1APIServiceSpec +from kubernetes_asyncio.client.models.v1_api_service_status import V1APIServiceStatus +from kubernetes_asyncio.client.models.v1_api_versions import V1APIVersions +from kubernetes_asyncio.client.models.v1_aws_elastic_block_store_volume_source import V1AWSElasticBlockStoreVolumeSource +from kubernetes_asyncio.client.models.v1_affinity import V1Affinity +from kubernetes_asyncio.client.models.v1_aggregation_rule import V1AggregationRule +from kubernetes_asyncio.client.models.v1_allocated_device_status import V1AllocatedDeviceStatus +from kubernetes_asyncio.client.models.v1_allocation_result import V1AllocationResult +from kubernetes_asyncio.client.models.v1_app_armor_profile import V1AppArmorProfile +from kubernetes_asyncio.client.models.v1_attached_volume import V1AttachedVolume +from kubernetes_asyncio.client.models.v1_audit_annotation import V1AuditAnnotation +from kubernetes_asyncio.client.models.v1_azure_disk_volume_source import V1AzureDiskVolumeSource +from kubernetes_asyncio.client.models.v1_azure_file_persistent_volume_source import V1AzureFilePersistentVolumeSource +from kubernetes_asyncio.client.models.v1_azure_file_volume_source import V1AzureFileVolumeSource +from kubernetes_asyncio.client.models.v1_binding import V1Binding +from kubernetes_asyncio.client.models.v1_bound_object_reference import V1BoundObjectReference +from kubernetes_asyncio.client.models.v1_cel_device_selector import V1CELDeviceSelector +from kubernetes_asyncio.client.models.v1_csi_driver import V1CSIDriver +from kubernetes_asyncio.client.models.v1_csi_driver_list import V1CSIDriverList +from kubernetes_asyncio.client.models.v1_csi_driver_spec import V1CSIDriverSpec +from kubernetes_asyncio.client.models.v1_csi_node import V1CSINode +from kubernetes_asyncio.client.models.v1_csi_node_driver import V1CSINodeDriver +from kubernetes_asyncio.client.models.v1_csi_node_list import V1CSINodeList +from kubernetes_asyncio.client.models.v1_csi_node_spec import V1CSINodeSpec +from kubernetes_asyncio.client.models.v1_csi_persistent_volume_source import V1CSIPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_csi_storage_capacity import V1CSIStorageCapacity +from kubernetes_asyncio.client.models.v1_csi_storage_capacity_list import V1CSIStorageCapacityList +from kubernetes_asyncio.client.models.v1_csi_volume_source import V1CSIVolumeSource +from kubernetes_asyncio.client.models.v1_capabilities import V1Capabilities +from kubernetes_asyncio.client.models.v1_capacity_request_policy import V1CapacityRequestPolicy +from kubernetes_asyncio.client.models.v1_capacity_request_policy_range import V1CapacityRequestPolicyRange +from kubernetes_asyncio.client.models.v1_capacity_requirements import V1CapacityRequirements +from kubernetes_asyncio.client.models.v1_ceph_fs_persistent_volume_source import V1CephFSPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_ceph_fs_volume_source import V1CephFSVolumeSource +from kubernetes_asyncio.client.models.v1_certificate_signing_request import V1CertificateSigningRequest +from kubernetes_asyncio.client.models.v1_certificate_signing_request_condition import V1CertificateSigningRequestCondition +from kubernetes_asyncio.client.models.v1_certificate_signing_request_list import V1CertificateSigningRequestList +from kubernetes_asyncio.client.models.v1_certificate_signing_request_spec import V1CertificateSigningRequestSpec +from kubernetes_asyncio.client.models.v1_certificate_signing_request_status import V1CertificateSigningRequestStatus +from kubernetes_asyncio.client.models.v1_cinder_persistent_volume_source import V1CinderPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_cinder_volume_source import V1CinderVolumeSource +from kubernetes_asyncio.client.models.v1_client_ip_config import V1ClientIPConfig +from kubernetes_asyncio.client.models.v1_cluster_role import V1ClusterRole +from kubernetes_asyncio.client.models.v1_cluster_role_binding import V1ClusterRoleBinding +from kubernetes_asyncio.client.models.v1_cluster_role_binding_list import V1ClusterRoleBindingList +from kubernetes_asyncio.client.models.v1_cluster_role_list import V1ClusterRoleList +from kubernetes_asyncio.client.models.v1_cluster_trust_bundle_projection import V1ClusterTrustBundleProjection +from kubernetes_asyncio.client.models.v1_component_condition import V1ComponentCondition +from kubernetes_asyncio.client.models.v1_component_status import V1ComponentStatus +from kubernetes_asyncio.client.models.v1_component_status_list import V1ComponentStatusList +from kubernetes_asyncio.client.models.v1_condition import V1Condition +from kubernetes_asyncio.client.models.v1_config_map import V1ConfigMap +from kubernetes_asyncio.client.models.v1_config_map_env_source import V1ConfigMapEnvSource +from kubernetes_asyncio.client.models.v1_config_map_key_selector import V1ConfigMapKeySelector +from kubernetes_asyncio.client.models.v1_config_map_list import V1ConfigMapList +from kubernetes_asyncio.client.models.v1_config_map_node_config_source import V1ConfigMapNodeConfigSource +from kubernetes_asyncio.client.models.v1_config_map_projection import V1ConfigMapProjection +from kubernetes_asyncio.client.models.v1_config_map_volume_source import V1ConfigMapVolumeSource +from kubernetes_asyncio.client.models.v1_container import V1Container +from kubernetes_asyncio.client.models.v1_container_extended_resource_request import V1ContainerExtendedResourceRequest +from kubernetes_asyncio.client.models.v1_container_image import V1ContainerImage +from kubernetes_asyncio.client.models.v1_container_port import V1ContainerPort +from kubernetes_asyncio.client.models.v1_container_resize_policy import V1ContainerResizePolicy +from kubernetes_asyncio.client.models.v1_container_restart_rule import V1ContainerRestartRule +from kubernetes_asyncio.client.models.v1_container_restart_rule_on_exit_codes import V1ContainerRestartRuleOnExitCodes +from kubernetes_asyncio.client.models.v1_container_state import V1ContainerState +from kubernetes_asyncio.client.models.v1_container_state_running import V1ContainerStateRunning +from kubernetes_asyncio.client.models.v1_container_state_terminated import V1ContainerStateTerminated +from kubernetes_asyncio.client.models.v1_container_state_waiting import V1ContainerStateWaiting +from kubernetes_asyncio.client.models.v1_container_status import V1ContainerStatus +from kubernetes_asyncio.client.models.v1_container_user import V1ContainerUser +from kubernetes_asyncio.client.models.v1_controller_revision import V1ControllerRevision +from kubernetes_asyncio.client.models.v1_controller_revision_list import V1ControllerRevisionList +from kubernetes_asyncio.client.models.v1_counter import V1Counter +from kubernetes_asyncio.client.models.v1_counter_set import V1CounterSet +from kubernetes_asyncio.client.models.v1_cron_job import V1CronJob +from kubernetes_asyncio.client.models.v1_cron_job_list import V1CronJobList +from kubernetes_asyncio.client.models.v1_cron_job_spec import V1CronJobSpec +from kubernetes_asyncio.client.models.v1_cron_job_status import V1CronJobStatus +from kubernetes_asyncio.client.models.v1_cross_version_object_reference import V1CrossVersionObjectReference +from kubernetes_asyncio.client.models.v1_custom_resource_column_definition import V1CustomResourceColumnDefinition +from kubernetes_asyncio.client.models.v1_custom_resource_conversion import V1CustomResourceConversion +from kubernetes_asyncio.client.models.v1_custom_resource_definition import V1CustomResourceDefinition +from kubernetes_asyncio.client.models.v1_custom_resource_definition_condition import V1CustomResourceDefinitionCondition +from kubernetes_asyncio.client.models.v1_custom_resource_definition_list import V1CustomResourceDefinitionList +from kubernetes_asyncio.client.models.v1_custom_resource_definition_names import V1CustomResourceDefinitionNames +from kubernetes_asyncio.client.models.v1_custom_resource_definition_spec import V1CustomResourceDefinitionSpec +from kubernetes_asyncio.client.models.v1_custom_resource_definition_status import V1CustomResourceDefinitionStatus +from kubernetes_asyncio.client.models.v1_custom_resource_definition_version import V1CustomResourceDefinitionVersion +from kubernetes_asyncio.client.models.v1_custom_resource_subresource_scale import V1CustomResourceSubresourceScale +from kubernetes_asyncio.client.models.v1_custom_resource_subresources import V1CustomResourceSubresources +from kubernetes_asyncio.client.models.v1_custom_resource_validation import V1CustomResourceValidation +from kubernetes_asyncio.client.models.v1_daemon_endpoint import V1DaemonEndpoint +from kubernetes_asyncio.client.models.v1_daemon_set import V1DaemonSet +from kubernetes_asyncio.client.models.v1_daemon_set_condition import V1DaemonSetCondition +from kubernetes_asyncio.client.models.v1_daemon_set_list import V1DaemonSetList +from kubernetes_asyncio.client.models.v1_daemon_set_spec import V1DaemonSetSpec +from kubernetes_asyncio.client.models.v1_daemon_set_status import V1DaemonSetStatus +from kubernetes_asyncio.client.models.v1_daemon_set_update_strategy import V1DaemonSetUpdateStrategy +from kubernetes_asyncio.client.models.v1_delete_options import V1DeleteOptions +from kubernetes_asyncio.client.models.v1_deployment import V1Deployment +from kubernetes_asyncio.client.models.v1_deployment_condition import V1DeploymentCondition +from kubernetes_asyncio.client.models.v1_deployment_list import V1DeploymentList +from kubernetes_asyncio.client.models.v1_deployment_spec import V1DeploymentSpec +from kubernetes_asyncio.client.models.v1_deployment_status import V1DeploymentStatus +from kubernetes_asyncio.client.models.v1_deployment_strategy import V1DeploymentStrategy +from kubernetes_asyncio.client.models.v1_device import V1Device +from kubernetes_asyncio.client.models.v1_device_allocation_configuration import V1DeviceAllocationConfiguration +from kubernetes_asyncio.client.models.v1_device_allocation_result import V1DeviceAllocationResult +from kubernetes_asyncio.client.models.v1_device_attribute import V1DeviceAttribute +from kubernetes_asyncio.client.models.v1_device_capacity import V1DeviceCapacity +from kubernetes_asyncio.client.models.v1_device_claim import V1DeviceClaim +from kubernetes_asyncio.client.models.v1_device_claim_configuration import V1DeviceClaimConfiguration +from kubernetes_asyncio.client.models.v1_device_class import V1DeviceClass +from kubernetes_asyncio.client.models.v1_device_class_configuration import V1DeviceClassConfiguration +from kubernetes_asyncio.client.models.v1_device_class_list import V1DeviceClassList +from kubernetes_asyncio.client.models.v1_device_class_spec import V1DeviceClassSpec +from kubernetes_asyncio.client.models.v1_device_constraint import V1DeviceConstraint +from kubernetes_asyncio.client.models.v1_device_counter_consumption import V1DeviceCounterConsumption +from kubernetes_asyncio.client.models.v1_device_request import V1DeviceRequest +from kubernetes_asyncio.client.models.v1_device_request_allocation_result import V1DeviceRequestAllocationResult +from kubernetes_asyncio.client.models.v1_device_selector import V1DeviceSelector +from kubernetes_asyncio.client.models.v1_device_sub_request import V1DeviceSubRequest +from kubernetes_asyncio.client.models.v1_device_taint import V1DeviceTaint +from kubernetes_asyncio.client.models.v1_device_toleration import V1DeviceToleration +from kubernetes_asyncio.client.models.v1_downward_api_projection import V1DownwardAPIProjection +from kubernetes_asyncio.client.models.v1_downward_api_volume_file import V1DownwardAPIVolumeFile +from kubernetes_asyncio.client.models.v1_downward_api_volume_source import V1DownwardAPIVolumeSource +from kubernetes_asyncio.client.models.v1_empty_dir_volume_source import V1EmptyDirVolumeSource +from kubernetes_asyncio.client.models.v1_endpoint import V1Endpoint +from kubernetes_asyncio.client.models.v1_endpoint_address import V1EndpointAddress +from kubernetes_asyncio.client.models.v1_endpoint_conditions import V1EndpointConditions +from kubernetes_asyncio.client.models.v1_endpoint_hints import V1EndpointHints +from kubernetes_asyncio.client.models.v1_endpoint_slice import V1EndpointSlice +from kubernetes_asyncio.client.models.v1_endpoint_slice_list import V1EndpointSliceList +from kubernetes_asyncio.client.models.v1_endpoint_subset import V1EndpointSubset +from kubernetes_asyncio.client.models.v1_endpoints import V1Endpoints +from kubernetes_asyncio.client.models.v1_endpoints_list import V1EndpointsList +from kubernetes_asyncio.client.models.v1_env_from_source import V1EnvFromSource +from kubernetes_asyncio.client.models.v1_env_var import V1EnvVar +from kubernetes_asyncio.client.models.v1_env_var_source import V1EnvVarSource +from kubernetes_asyncio.client.models.v1_ephemeral_container import V1EphemeralContainer +from kubernetes_asyncio.client.models.v1_ephemeral_volume_source import V1EphemeralVolumeSource +from kubernetes_asyncio.client.models.v1_event_source import V1EventSource +from kubernetes_asyncio.client.models.v1_eviction import V1Eviction +from kubernetes_asyncio.client.models.v1_exact_device_request import V1ExactDeviceRequest +from kubernetes_asyncio.client.models.v1_exec_action import V1ExecAction +from kubernetes_asyncio.client.models.v1_exempt_priority_level_configuration import V1ExemptPriorityLevelConfiguration +from kubernetes_asyncio.client.models.v1_expression_warning import V1ExpressionWarning +from kubernetes_asyncio.client.models.v1_external_documentation import V1ExternalDocumentation +from kubernetes_asyncio.client.models.v1_fc_volume_source import V1FCVolumeSource +from kubernetes_asyncio.client.models.v1_field_selector_attributes import V1FieldSelectorAttributes +from kubernetes_asyncio.client.models.v1_field_selector_requirement import V1FieldSelectorRequirement +from kubernetes_asyncio.client.models.v1_file_key_selector import V1FileKeySelector +from kubernetes_asyncio.client.models.v1_flex_persistent_volume_source import V1FlexPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_flex_volume_source import V1FlexVolumeSource +from kubernetes_asyncio.client.models.v1_flocker_volume_source import V1FlockerVolumeSource +from kubernetes_asyncio.client.models.v1_flow_distinguisher_method import V1FlowDistinguisherMethod +from kubernetes_asyncio.client.models.v1_flow_schema import V1FlowSchema +from kubernetes_asyncio.client.models.v1_flow_schema_condition import V1FlowSchemaCondition +from kubernetes_asyncio.client.models.v1_flow_schema_list import V1FlowSchemaList +from kubernetes_asyncio.client.models.v1_flow_schema_spec import V1FlowSchemaSpec +from kubernetes_asyncio.client.models.v1_flow_schema_status import V1FlowSchemaStatus +from kubernetes_asyncio.client.models.v1_for_node import V1ForNode +from kubernetes_asyncio.client.models.v1_for_zone import V1ForZone +from kubernetes_asyncio.client.models.v1_gce_persistent_disk_volume_source import V1GCEPersistentDiskVolumeSource +from kubernetes_asyncio.client.models.v1_grpc_action import V1GRPCAction +from kubernetes_asyncio.client.models.v1_git_repo_volume_source import V1GitRepoVolumeSource +from kubernetes_asyncio.client.models.v1_glusterfs_persistent_volume_source import V1GlusterfsPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_glusterfs_volume_source import V1GlusterfsVolumeSource +from kubernetes_asyncio.client.models.v1_group_resource import V1GroupResource +from kubernetes_asyncio.client.models.v1_group_subject import V1GroupSubject +from kubernetes_asyncio.client.models.v1_group_version_for_discovery import V1GroupVersionForDiscovery +from kubernetes_asyncio.client.models.v1_http_get_action import V1HTTPGetAction +from kubernetes_asyncio.client.models.v1_http_header import V1HTTPHeader +from kubernetes_asyncio.client.models.v1_http_ingress_path import V1HTTPIngressPath +from kubernetes_asyncio.client.models.v1_http_ingress_rule_value import V1HTTPIngressRuleValue +from kubernetes_asyncio.client.models.v1_horizontal_pod_autoscaler import V1HorizontalPodAutoscaler +from kubernetes_asyncio.client.models.v1_horizontal_pod_autoscaler_list import V1HorizontalPodAutoscalerList +from kubernetes_asyncio.client.models.v1_horizontal_pod_autoscaler_spec import V1HorizontalPodAutoscalerSpec +from kubernetes_asyncio.client.models.v1_horizontal_pod_autoscaler_status import V1HorizontalPodAutoscalerStatus +from kubernetes_asyncio.client.models.v1_host_alias import V1HostAlias +from kubernetes_asyncio.client.models.v1_host_ip import V1HostIP +from kubernetes_asyncio.client.models.v1_host_path_volume_source import V1HostPathVolumeSource +from kubernetes_asyncio.client.models.v1_ip_address import V1IPAddress +from kubernetes_asyncio.client.models.v1_ip_address_list import V1IPAddressList +from kubernetes_asyncio.client.models.v1_ip_address_spec import V1IPAddressSpec +from kubernetes_asyncio.client.models.v1_ip_block import V1IPBlock +from kubernetes_asyncio.client.models.v1_iscsi_persistent_volume_source import V1ISCSIPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_iscsi_volume_source import V1ISCSIVolumeSource +from kubernetes_asyncio.client.models.v1_image_volume_source import V1ImageVolumeSource +from kubernetes_asyncio.client.models.v1_ingress import V1Ingress +from kubernetes_asyncio.client.models.v1_ingress_backend import V1IngressBackend +from kubernetes_asyncio.client.models.v1_ingress_class import V1IngressClass +from kubernetes_asyncio.client.models.v1_ingress_class_list import V1IngressClassList +from kubernetes_asyncio.client.models.v1_ingress_class_parameters_reference import V1IngressClassParametersReference +from kubernetes_asyncio.client.models.v1_ingress_class_spec import V1IngressClassSpec +from kubernetes_asyncio.client.models.v1_ingress_list import V1IngressList +from kubernetes_asyncio.client.models.v1_ingress_load_balancer_ingress import V1IngressLoadBalancerIngress +from kubernetes_asyncio.client.models.v1_ingress_load_balancer_status import V1IngressLoadBalancerStatus +from kubernetes_asyncio.client.models.v1_ingress_port_status import V1IngressPortStatus +from kubernetes_asyncio.client.models.v1_ingress_rule import V1IngressRule +from kubernetes_asyncio.client.models.v1_ingress_service_backend import V1IngressServiceBackend +from kubernetes_asyncio.client.models.v1_ingress_spec import V1IngressSpec +from kubernetes_asyncio.client.models.v1_ingress_status import V1IngressStatus +from kubernetes_asyncio.client.models.v1_ingress_tls import V1IngressTLS +from kubernetes_asyncio.client.models.v1_json_schema_props import V1JSONSchemaProps +from kubernetes_asyncio.client.models.v1_job import V1Job +from kubernetes_asyncio.client.models.v1_job_condition import V1JobCondition +from kubernetes_asyncio.client.models.v1_job_list import V1JobList +from kubernetes_asyncio.client.models.v1_job_spec import V1JobSpec +from kubernetes_asyncio.client.models.v1_job_status import V1JobStatus +from kubernetes_asyncio.client.models.v1_job_template_spec import V1JobTemplateSpec +from kubernetes_asyncio.client.models.v1_key_to_path import V1KeyToPath +from kubernetes_asyncio.client.models.v1_label_selector import V1LabelSelector +from kubernetes_asyncio.client.models.v1_label_selector_attributes import V1LabelSelectorAttributes +from kubernetes_asyncio.client.models.v1_label_selector_requirement import V1LabelSelectorRequirement +from kubernetes_asyncio.client.models.v1_lease import V1Lease +from kubernetes_asyncio.client.models.v1_lease_list import V1LeaseList +from kubernetes_asyncio.client.models.v1_lease_spec import V1LeaseSpec +from kubernetes_asyncio.client.models.v1_lifecycle import V1Lifecycle +from kubernetes_asyncio.client.models.v1_lifecycle_handler import V1LifecycleHandler +from kubernetes_asyncio.client.models.v1_limit_range import V1LimitRange +from kubernetes_asyncio.client.models.v1_limit_range_item import V1LimitRangeItem +from kubernetes_asyncio.client.models.v1_limit_range_list import V1LimitRangeList +from kubernetes_asyncio.client.models.v1_limit_range_spec import V1LimitRangeSpec +from kubernetes_asyncio.client.models.v1_limit_response import V1LimitResponse +from kubernetes_asyncio.client.models.v1_limited_priority_level_configuration import V1LimitedPriorityLevelConfiguration +from kubernetes_asyncio.client.models.v1_linux_container_user import V1LinuxContainerUser +from kubernetes_asyncio.client.models.v1_list_meta import V1ListMeta +from kubernetes_asyncio.client.models.v1_load_balancer_ingress import V1LoadBalancerIngress +from kubernetes_asyncio.client.models.v1_load_balancer_status import V1LoadBalancerStatus +from kubernetes_asyncio.client.models.v1_local_object_reference import V1LocalObjectReference +from kubernetes_asyncio.client.models.v1_local_subject_access_review import V1LocalSubjectAccessReview +from kubernetes_asyncio.client.models.v1_local_volume_source import V1LocalVolumeSource +from kubernetes_asyncio.client.models.v1_managed_fields_entry import V1ManagedFieldsEntry +from kubernetes_asyncio.client.models.v1_match_condition import V1MatchCondition +from kubernetes_asyncio.client.models.v1_match_resources import V1MatchResources +from kubernetes_asyncio.client.models.v1_modify_volume_status import V1ModifyVolumeStatus +from kubernetes_asyncio.client.models.v1_mutating_webhook import V1MutatingWebhook +from kubernetes_asyncio.client.models.v1_mutating_webhook_configuration import V1MutatingWebhookConfiguration +from kubernetes_asyncio.client.models.v1_mutating_webhook_configuration_list import V1MutatingWebhookConfigurationList +from kubernetes_asyncio.client.models.v1_nfs_volume_source import V1NFSVolumeSource +from kubernetes_asyncio.client.models.v1_named_rule_with_operations import V1NamedRuleWithOperations +from kubernetes_asyncio.client.models.v1_namespace import V1Namespace +from kubernetes_asyncio.client.models.v1_namespace_condition import V1NamespaceCondition +from kubernetes_asyncio.client.models.v1_namespace_list import V1NamespaceList +from kubernetes_asyncio.client.models.v1_namespace_spec import V1NamespaceSpec +from kubernetes_asyncio.client.models.v1_namespace_status import V1NamespaceStatus +from kubernetes_asyncio.client.models.v1_network_device_data import V1NetworkDeviceData +from kubernetes_asyncio.client.models.v1_network_policy import V1NetworkPolicy +from kubernetes_asyncio.client.models.v1_network_policy_egress_rule import V1NetworkPolicyEgressRule +from kubernetes_asyncio.client.models.v1_network_policy_ingress_rule import V1NetworkPolicyIngressRule +from kubernetes_asyncio.client.models.v1_network_policy_list import V1NetworkPolicyList +from kubernetes_asyncio.client.models.v1_network_policy_peer import V1NetworkPolicyPeer +from kubernetes_asyncio.client.models.v1_network_policy_port import V1NetworkPolicyPort +from kubernetes_asyncio.client.models.v1_network_policy_spec import V1NetworkPolicySpec +from kubernetes_asyncio.client.models.v1_node import V1Node +from kubernetes_asyncio.client.models.v1_node_address import V1NodeAddress +from kubernetes_asyncio.client.models.v1_node_affinity import V1NodeAffinity +from kubernetes_asyncio.client.models.v1_node_condition import V1NodeCondition +from kubernetes_asyncio.client.models.v1_node_config_source import V1NodeConfigSource +from kubernetes_asyncio.client.models.v1_node_config_status import V1NodeConfigStatus +from kubernetes_asyncio.client.models.v1_node_daemon_endpoints import V1NodeDaemonEndpoints +from kubernetes_asyncio.client.models.v1_node_features import V1NodeFeatures +from kubernetes_asyncio.client.models.v1_node_list import V1NodeList +from kubernetes_asyncio.client.models.v1_node_runtime_handler import V1NodeRuntimeHandler +from kubernetes_asyncio.client.models.v1_node_runtime_handler_features import V1NodeRuntimeHandlerFeatures +from kubernetes_asyncio.client.models.v1_node_selector import V1NodeSelector +from kubernetes_asyncio.client.models.v1_node_selector_requirement import V1NodeSelectorRequirement +from kubernetes_asyncio.client.models.v1_node_selector_term import V1NodeSelectorTerm +from kubernetes_asyncio.client.models.v1_node_spec import V1NodeSpec +from kubernetes_asyncio.client.models.v1_node_status import V1NodeStatus +from kubernetes_asyncio.client.models.v1_node_swap_status import V1NodeSwapStatus +from kubernetes_asyncio.client.models.v1_node_system_info import V1NodeSystemInfo +from kubernetes_asyncio.client.models.v1_non_resource_attributes import V1NonResourceAttributes +from kubernetes_asyncio.client.models.v1_non_resource_policy_rule import V1NonResourcePolicyRule +from kubernetes_asyncio.client.models.v1_non_resource_rule import V1NonResourceRule +from kubernetes_asyncio.client.models.v1_object_field_selector import V1ObjectFieldSelector +from kubernetes_asyncio.client.models.v1_object_meta import V1ObjectMeta +from kubernetes_asyncio.client.models.v1_object_reference import V1ObjectReference +from kubernetes_asyncio.client.models.v1_opaque_device_configuration import V1OpaqueDeviceConfiguration +from kubernetes_asyncio.client.models.v1_overhead import V1Overhead +from kubernetes_asyncio.client.models.v1_owner_reference import V1OwnerReference +from kubernetes_asyncio.client.models.v1_param_kind import V1ParamKind +from kubernetes_asyncio.client.models.v1_param_ref import V1ParamRef +from kubernetes_asyncio.client.models.v1_parent_reference import V1ParentReference +from kubernetes_asyncio.client.models.v1_persistent_volume import V1PersistentVolume +from kubernetes_asyncio.client.models.v1_persistent_volume_claim import V1PersistentVolumeClaim +from kubernetes_asyncio.client.models.v1_persistent_volume_claim_condition import V1PersistentVolumeClaimCondition +from kubernetes_asyncio.client.models.v1_persistent_volume_claim_list import V1PersistentVolumeClaimList +from kubernetes_asyncio.client.models.v1_persistent_volume_claim_spec import V1PersistentVolumeClaimSpec +from kubernetes_asyncio.client.models.v1_persistent_volume_claim_status import V1PersistentVolumeClaimStatus +from kubernetes_asyncio.client.models.v1_persistent_volume_claim_template import V1PersistentVolumeClaimTemplate +from kubernetes_asyncio.client.models.v1_persistent_volume_claim_volume_source import V1PersistentVolumeClaimVolumeSource +from kubernetes_asyncio.client.models.v1_persistent_volume_list import V1PersistentVolumeList +from kubernetes_asyncio.client.models.v1_persistent_volume_spec import V1PersistentVolumeSpec +from kubernetes_asyncio.client.models.v1_persistent_volume_status import V1PersistentVolumeStatus +from kubernetes_asyncio.client.models.v1_photon_persistent_disk_volume_source import V1PhotonPersistentDiskVolumeSource +from kubernetes_asyncio.client.models.v1_pod import V1Pod +from kubernetes_asyncio.client.models.v1_pod_affinity import V1PodAffinity +from kubernetes_asyncio.client.models.v1_pod_affinity_term import V1PodAffinityTerm +from kubernetes_asyncio.client.models.v1_pod_anti_affinity import V1PodAntiAffinity +from kubernetes_asyncio.client.models.v1_pod_certificate_projection import V1PodCertificateProjection +from kubernetes_asyncio.client.models.v1_pod_condition import V1PodCondition +from kubernetes_asyncio.client.models.v1_pod_dns_config import V1PodDNSConfig +from kubernetes_asyncio.client.models.v1_pod_dns_config_option import V1PodDNSConfigOption +from kubernetes_asyncio.client.models.v1_pod_disruption_budget import V1PodDisruptionBudget +from kubernetes_asyncio.client.models.v1_pod_disruption_budget_list import V1PodDisruptionBudgetList +from kubernetes_asyncio.client.models.v1_pod_disruption_budget_spec import V1PodDisruptionBudgetSpec +from kubernetes_asyncio.client.models.v1_pod_disruption_budget_status import V1PodDisruptionBudgetStatus +from kubernetes_asyncio.client.models.v1_pod_extended_resource_claim_status import V1PodExtendedResourceClaimStatus +from kubernetes_asyncio.client.models.v1_pod_failure_policy import V1PodFailurePolicy +from kubernetes_asyncio.client.models.v1_pod_failure_policy_on_exit_codes_requirement import V1PodFailurePolicyOnExitCodesRequirement +from kubernetes_asyncio.client.models.v1_pod_failure_policy_on_pod_conditions_pattern import V1PodFailurePolicyOnPodConditionsPattern +from kubernetes_asyncio.client.models.v1_pod_failure_policy_rule import V1PodFailurePolicyRule +from kubernetes_asyncio.client.models.v1_pod_ip import V1PodIP +from kubernetes_asyncio.client.models.v1_pod_list import V1PodList +from kubernetes_asyncio.client.models.v1_pod_os import V1PodOS +from kubernetes_asyncio.client.models.v1_pod_readiness_gate import V1PodReadinessGate +from kubernetes_asyncio.client.models.v1_pod_resource_claim import V1PodResourceClaim +from kubernetes_asyncio.client.models.v1_pod_resource_claim_status import V1PodResourceClaimStatus +from kubernetes_asyncio.client.models.v1_pod_scheduling_gate import V1PodSchedulingGate +from kubernetes_asyncio.client.models.v1_pod_security_context import V1PodSecurityContext +from kubernetes_asyncio.client.models.v1_pod_spec import V1PodSpec +from kubernetes_asyncio.client.models.v1_pod_status import V1PodStatus +from kubernetes_asyncio.client.models.v1_pod_template import V1PodTemplate +from kubernetes_asyncio.client.models.v1_pod_template_list import V1PodTemplateList +from kubernetes_asyncio.client.models.v1_pod_template_spec import V1PodTemplateSpec +from kubernetes_asyncio.client.models.v1_policy_rule import V1PolicyRule +from kubernetes_asyncio.client.models.v1_policy_rules_with_subjects import V1PolicyRulesWithSubjects +from kubernetes_asyncio.client.models.v1_port_status import V1PortStatus +from kubernetes_asyncio.client.models.v1_portworx_volume_source import V1PortworxVolumeSource +from kubernetes_asyncio.client.models.v1_preconditions import V1Preconditions +from kubernetes_asyncio.client.models.v1_preferred_scheduling_term import V1PreferredSchedulingTerm +from kubernetes_asyncio.client.models.v1_priority_class import V1PriorityClass +from kubernetes_asyncio.client.models.v1_priority_class_list import V1PriorityClassList +from kubernetes_asyncio.client.models.v1_priority_level_configuration import V1PriorityLevelConfiguration +from kubernetes_asyncio.client.models.v1_priority_level_configuration_condition import V1PriorityLevelConfigurationCondition +from kubernetes_asyncio.client.models.v1_priority_level_configuration_list import V1PriorityLevelConfigurationList +from kubernetes_asyncio.client.models.v1_priority_level_configuration_reference import V1PriorityLevelConfigurationReference +from kubernetes_asyncio.client.models.v1_priority_level_configuration_spec import V1PriorityLevelConfigurationSpec +from kubernetes_asyncio.client.models.v1_priority_level_configuration_status import V1PriorityLevelConfigurationStatus +from kubernetes_asyncio.client.models.v1_probe import V1Probe +from kubernetes_asyncio.client.models.v1_projected_volume_source import V1ProjectedVolumeSource +from kubernetes_asyncio.client.models.v1_queuing_configuration import V1QueuingConfiguration +from kubernetes_asyncio.client.models.v1_quobyte_volume_source import V1QuobyteVolumeSource +from kubernetes_asyncio.client.models.v1_rbd_persistent_volume_source import V1RBDPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_rbd_volume_source import V1RBDVolumeSource +from kubernetes_asyncio.client.models.v1_replica_set import V1ReplicaSet +from kubernetes_asyncio.client.models.v1_replica_set_condition import V1ReplicaSetCondition +from kubernetes_asyncio.client.models.v1_replica_set_list import V1ReplicaSetList +from kubernetes_asyncio.client.models.v1_replica_set_spec import V1ReplicaSetSpec +from kubernetes_asyncio.client.models.v1_replica_set_status import V1ReplicaSetStatus +from kubernetes_asyncio.client.models.v1_replication_controller import V1ReplicationController +from kubernetes_asyncio.client.models.v1_replication_controller_condition import V1ReplicationControllerCondition +from kubernetes_asyncio.client.models.v1_replication_controller_list import V1ReplicationControllerList +from kubernetes_asyncio.client.models.v1_replication_controller_spec import V1ReplicationControllerSpec +from kubernetes_asyncio.client.models.v1_replication_controller_status import V1ReplicationControllerStatus +from kubernetes_asyncio.client.models.v1_resource_attributes import V1ResourceAttributes +from kubernetes_asyncio.client.models.v1_resource_claim_consumer_reference import V1ResourceClaimConsumerReference +from kubernetes_asyncio.client.models.v1_resource_claim_list import V1ResourceClaimList +from kubernetes_asyncio.client.models.v1_resource_claim_spec import V1ResourceClaimSpec +from kubernetes_asyncio.client.models.v1_resource_claim_status import V1ResourceClaimStatus +from kubernetes_asyncio.client.models.v1_resource_claim_template import V1ResourceClaimTemplate +from kubernetes_asyncio.client.models.v1_resource_claim_template_list import V1ResourceClaimTemplateList +from kubernetes_asyncio.client.models.v1_resource_claim_template_spec import V1ResourceClaimTemplateSpec +from kubernetes_asyncio.client.models.v1_resource_field_selector import V1ResourceFieldSelector +from kubernetes_asyncio.client.models.v1_resource_health import V1ResourceHealth +from kubernetes_asyncio.client.models.v1_resource_policy_rule import V1ResourcePolicyRule +from kubernetes_asyncio.client.models.v1_resource_pool import V1ResourcePool +from kubernetes_asyncio.client.models.v1_resource_quota import V1ResourceQuota +from kubernetes_asyncio.client.models.v1_resource_quota_list import V1ResourceQuotaList +from kubernetes_asyncio.client.models.v1_resource_quota_spec import V1ResourceQuotaSpec +from kubernetes_asyncio.client.models.v1_resource_quota_status import V1ResourceQuotaStatus +from kubernetes_asyncio.client.models.v1_resource_requirements import V1ResourceRequirements +from kubernetes_asyncio.client.models.v1_resource_rule import V1ResourceRule +from kubernetes_asyncio.client.models.v1_resource_slice import V1ResourceSlice +from kubernetes_asyncio.client.models.v1_resource_slice_list import V1ResourceSliceList +from kubernetes_asyncio.client.models.v1_resource_slice_spec import V1ResourceSliceSpec +from kubernetes_asyncio.client.models.v1_resource_status import V1ResourceStatus +from kubernetes_asyncio.client.models.v1_role import V1Role +from kubernetes_asyncio.client.models.v1_role_binding import V1RoleBinding +from kubernetes_asyncio.client.models.v1_role_binding_list import V1RoleBindingList +from kubernetes_asyncio.client.models.v1_role_list import V1RoleList +from kubernetes_asyncio.client.models.v1_role_ref import V1RoleRef +from kubernetes_asyncio.client.models.v1_rolling_update_daemon_set import V1RollingUpdateDaemonSet +from kubernetes_asyncio.client.models.v1_rolling_update_deployment import V1RollingUpdateDeployment +from kubernetes_asyncio.client.models.v1_rolling_update_stateful_set_strategy import V1RollingUpdateStatefulSetStrategy +from kubernetes_asyncio.client.models.v1_rule_with_operations import V1RuleWithOperations +from kubernetes_asyncio.client.models.v1_runtime_class import V1RuntimeClass +from kubernetes_asyncio.client.models.v1_runtime_class_list import V1RuntimeClassList +from kubernetes_asyncio.client.models.v1_se_linux_options import V1SELinuxOptions +from kubernetes_asyncio.client.models.v1_scale import V1Scale +from kubernetes_asyncio.client.models.v1_scale_io_persistent_volume_source import V1ScaleIOPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_scale_io_volume_source import V1ScaleIOVolumeSource +from kubernetes_asyncio.client.models.v1_scale_spec import V1ScaleSpec +from kubernetes_asyncio.client.models.v1_scale_status import V1ScaleStatus +from kubernetes_asyncio.client.models.v1_scheduling import V1Scheduling +from kubernetes_asyncio.client.models.v1_scope_selector import V1ScopeSelector +from kubernetes_asyncio.client.models.v1_scoped_resource_selector_requirement import V1ScopedResourceSelectorRequirement +from kubernetes_asyncio.client.models.v1_seccomp_profile import V1SeccompProfile +from kubernetes_asyncio.client.models.v1_secret import V1Secret +from kubernetes_asyncio.client.models.v1_secret_env_source import V1SecretEnvSource +from kubernetes_asyncio.client.models.v1_secret_key_selector import V1SecretKeySelector +from kubernetes_asyncio.client.models.v1_secret_list import V1SecretList +from kubernetes_asyncio.client.models.v1_secret_projection import V1SecretProjection +from kubernetes_asyncio.client.models.v1_secret_reference import V1SecretReference +from kubernetes_asyncio.client.models.v1_secret_volume_source import V1SecretVolumeSource +from kubernetes_asyncio.client.models.v1_security_context import V1SecurityContext +from kubernetes_asyncio.client.models.v1_selectable_field import V1SelectableField +from kubernetes_asyncio.client.models.v1_self_subject_access_review import V1SelfSubjectAccessReview +from kubernetes_asyncio.client.models.v1_self_subject_access_review_spec import V1SelfSubjectAccessReviewSpec +from kubernetes_asyncio.client.models.v1_self_subject_review import V1SelfSubjectReview +from kubernetes_asyncio.client.models.v1_self_subject_review_status import V1SelfSubjectReviewStatus +from kubernetes_asyncio.client.models.v1_self_subject_rules_review import V1SelfSubjectRulesReview +from kubernetes_asyncio.client.models.v1_self_subject_rules_review_spec import V1SelfSubjectRulesReviewSpec +from kubernetes_asyncio.client.models.v1_server_address_by_client_cidr import V1ServerAddressByClientCIDR +from kubernetes_asyncio.client.models.v1_service import V1Service +from kubernetes_asyncio.client.models.v1_service_account import V1ServiceAccount +from kubernetes_asyncio.client.models.v1_service_account_list import V1ServiceAccountList +from kubernetes_asyncio.client.models.v1_service_account_subject import V1ServiceAccountSubject +from kubernetes_asyncio.client.models.v1_service_account_token_projection import V1ServiceAccountTokenProjection +from kubernetes_asyncio.client.models.v1_service_backend_port import V1ServiceBackendPort +from kubernetes_asyncio.client.models.v1_service_cidr import V1ServiceCIDR +from kubernetes_asyncio.client.models.v1_service_cidr_list import V1ServiceCIDRList +from kubernetes_asyncio.client.models.v1_service_cidr_spec import V1ServiceCIDRSpec +from kubernetes_asyncio.client.models.v1_service_cidr_status import V1ServiceCIDRStatus +from kubernetes_asyncio.client.models.v1_service_list import V1ServiceList +from kubernetes_asyncio.client.models.v1_service_port import V1ServicePort +from kubernetes_asyncio.client.models.v1_service_spec import V1ServiceSpec +from kubernetes_asyncio.client.models.v1_service_status import V1ServiceStatus +from kubernetes_asyncio.client.models.v1_session_affinity_config import V1SessionAffinityConfig +from kubernetes_asyncio.client.models.v1_sleep_action import V1SleepAction +from kubernetes_asyncio.client.models.v1_stateful_set import V1StatefulSet +from kubernetes_asyncio.client.models.v1_stateful_set_condition import V1StatefulSetCondition +from kubernetes_asyncio.client.models.v1_stateful_set_list import V1StatefulSetList +from kubernetes_asyncio.client.models.v1_stateful_set_ordinals import V1StatefulSetOrdinals +from kubernetes_asyncio.client.models.v1_stateful_set_persistent_volume_claim_retention_policy import V1StatefulSetPersistentVolumeClaimRetentionPolicy +from kubernetes_asyncio.client.models.v1_stateful_set_spec import V1StatefulSetSpec +from kubernetes_asyncio.client.models.v1_stateful_set_status import V1StatefulSetStatus +from kubernetes_asyncio.client.models.v1_stateful_set_update_strategy import V1StatefulSetUpdateStrategy +from kubernetes_asyncio.client.models.v1_status import V1Status +from kubernetes_asyncio.client.models.v1_status_cause import V1StatusCause +from kubernetes_asyncio.client.models.v1_status_details import V1StatusDetails +from kubernetes_asyncio.client.models.v1_storage_class import V1StorageClass +from kubernetes_asyncio.client.models.v1_storage_class_list import V1StorageClassList +from kubernetes_asyncio.client.models.v1_storage_os_persistent_volume_source import V1StorageOSPersistentVolumeSource +from kubernetes_asyncio.client.models.v1_storage_os_volume_source import V1StorageOSVolumeSource +from kubernetes_asyncio.client.models.v1_subject_access_review import V1SubjectAccessReview +from kubernetes_asyncio.client.models.v1_subject_access_review_spec import V1SubjectAccessReviewSpec +from kubernetes_asyncio.client.models.v1_subject_access_review_status import V1SubjectAccessReviewStatus +from kubernetes_asyncio.client.models.v1_subject_rules_review_status import V1SubjectRulesReviewStatus +from kubernetes_asyncio.client.models.v1_success_policy import V1SuccessPolicy +from kubernetes_asyncio.client.models.v1_success_policy_rule import V1SuccessPolicyRule +from kubernetes_asyncio.client.models.v1_sysctl import V1Sysctl +from kubernetes_asyncio.client.models.v1_tcp_socket_action import V1TCPSocketAction +from kubernetes_asyncio.client.models.v1_taint import V1Taint +from kubernetes_asyncio.client.models.v1_token_request_spec import V1TokenRequestSpec +from kubernetes_asyncio.client.models.v1_token_request_status import V1TokenRequestStatus +from kubernetes_asyncio.client.models.v1_token_review import V1TokenReview +from kubernetes_asyncio.client.models.v1_token_review_spec import V1TokenReviewSpec +from kubernetes_asyncio.client.models.v1_token_review_status import V1TokenReviewStatus +from kubernetes_asyncio.client.models.v1_toleration import V1Toleration +from kubernetes_asyncio.client.models.v1_topology_selector_label_requirement import V1TopologySelectorLabelRequirement +from kubernetes_asyncio.client.models.v1_topology_selector_term import V1TopologySelectorTerm +from kubernetes_asyncio.client.models.v1_topology_spread_constraint import V1TopologySpreadConstraint +from kubernetes_asyncio.client.models.v1_type_checking import V1TypeChecking +from kubernetes_asyncio.client.models.v1_typed_local_object_reference import V1TypedLocalObjectReference +from kubernetes_asyncio.client.models.v1_typed_object_reference import V1TypedObjectReference +from kubernetes_asyncio.client.models.v1_uncounted_terminated_pods import V1UncountedTerminatedPods +from kubernetes_asyncio.client.models.v1_user_info import V1UserInfo +from kubernetes_asyncio.client.models.v1_user_subject import V1UserSubject +from kubernetes_asyncio.client.models.v1_validating_admission_policy import V1ValidatingAdmissionPolicy +from kubernetes_asyncio.client.models.v1_validating_admission_policy_binding import V1ValidatingAdmissionPolicyBinding +from kubernetes_asyncio.client.models.v1_validating_admission_policy_binding_list import V1ValidatingAdmissionPolicyBindingList +from kubernetes_asyncio.client.models.v1_validating_admission_policy_binding_spec import V1ValidatingAdmissionPolicyBindingSpec +from kubernetes_asyncio.client.models.v1_validating_admission_policy_list import V1ValidatingAdmissionPolicyList +from kubernetes_asyncio.client.models.v1_validating_admission_policy_spec import V1ValidatingAdmissionPolicySpec +from kubernetes_asyncio.client.models.v1_validating_admission_policy_status import V1ValidatingAdmissionPolicyStatus +from kubernetes_asyncio.client.models.v1_validating_webhook import V1ValidatingWebhook +from kubernetes_asyncio.client.models.v1_validating_webhook_configuration import V1ValidatingWebhookConfiguration +from kubernetes_asyncio.client.models.v1_validating_webhook_configuration_list import V1ValidatingWebhookConfigurationList +from kubernetes_asyncio.client.models.v1_validation import V1Validation +from kubernetes_asyncio.client.models.v1_validation_rule import V1ValidationRule +from kubernetes_asyncio.client.models.v1_variable import V1Variable +from kubernetes_asyncio.client.models.v1_volume import V1Volume +from kubernetes_asyncio.client.models.v1_volume_attachment import V1VolumeAttachment +from kubernetes_asyncio.client.models.v1_volume_attachment_list import V1VolumeAttachmentList +from kubernetes_asyncio.client.models.v1_volume_attachment_source import V1VolumeAttachmentSource +from kubernetes_asyncio.client.models.v1_volume_attachment_spec import V1VolumeAttachmentSpec +from kubernetes_asyncio.client.models.v1_volume_attachment_status import V1VolumeAttachmentStatus +from kubernetes_asyncio.client.models.v1_volume_attributes_class import V1VolumeAttributesClass +from kubernetes_asyncio.client.models.v1_volume_attributes_class_list import V1VolumeAttributesClassList +from kubernetes_asyncio.client.models.v1_volume_device import V1VolumeDevice +from kubernetes_asyncio.client.models.v1_volume_error import V1VolumeError +from kubernetes_asyncio.client.models.v1_volume_mount import V1VolumeMount +from kubernetes_asyncio.client.models.v1_volume_mount_status import V1VolumeMountStatus +from kubernetes_asyncio.client.models.v1_volume_node_affinity import V1VolumeNodeAffinity +from kubernetes_asyncio.client.models.v1_volume_node_resources import V1VolumeNodeResources +from kubernetes_asyncio.client.models.v1_volume_projection import V1VolumeProjection +from kubernetes_asyncio.client.models.v1_volume_resource_requirements import V1VolumeResourceRequirements +from kubernetes_asyncio.client.models.v1_vsphere_virtual_disk_volume_source import V1VsphereVirtualDiskVolumeSource +from kubernetes_asyncio.client.models.v1_watch_event import V1WatchEvent +from kubernetes_asyncio.client.models.v1_webhook_conversion import V1WebhookConversion +from kubernetes_asyncio.client.models.v1_weighted_pod_affinity_term import V1WeightedPodAffinityTerm +from kubernetes_asyncio.client.models.v1_windows_security_context_options import V1WindowsSecurityContextOptions +from kubernetes_asyncio.client.models.v1_workload_reference import V1WorkloadReference +from kubernetes_asyncio.client.models.v1alpha1_apply_configuration import V1alpha1ApplyConfiguration +from kubernetes_asyncio.client.models.v1alpha1_cluster_trust_bundle import V1alpha1ClusterTrustBundle +from kubernetes_asyncio.client.models.v1alpha1_cluster_trust_bundle_list import V1alpha1ClusterTrustBundleList +from kubernetes_asyncio.client.models.v1alpha1_cluster_trust_bundle_spec import V1alpha1ClusterTrustBundleSpec +from kubernetes_asyncio.client.models.v1alpha1_gang_scheduling_policy import V1alpha1GangSchedulingPolicy +from kubernetes_asyncio.client.models.v1alpha1_json_patch import V1alpha1JSONPatch +from kubernetes_asyncio.client.models.v1alpha1_match_condition import V1alpha1MatchCondition +from kubernetes_asyncio.client.models.v1alpha1_match_resources import V1alpha1MatchResources +from kubernetes_asyncio.client.models.v1alpha1_mutating_admission_policy import V1alpha1MutatingAdmissionPolicy +from kubernetes_asyncio.client.models.v1alpha1_mutating_admission_policy_binding import V1alpha1MutatingAdmissionPolicyBinding +from kubernetes_asyncio.client.models.v1alpha1_mutating_admission_policy_binding_list import V1alpha1MutatingAdmissionPolicyBindingList +from kubernetes_asyncio.client.models.v1alpha1_mutating_admission_policy_binding_spec import V1alpha1MutatingAdmissionPolicyBindingSpec +from kubernetes_asyncio.client.models.v1alpha1_mutating_admission_policy_list import V1alpha1MutatingAdmissionPolicyList +from kubernetes_asyncio.client.models.v1alpha1_mutating_admission_policy_spec import V1alpha1MutatingAdmissionPolicySpec +from kubernetes_asyncio.client.models.v1alpha1_mutation import V1alpha1Mutation +from kubernetes_asyncio.client.models.v1alpha1_named_rule_with_operations import V1alpha1NamedRuleWithOperations +from kubernetes_asyncio.client.models.v1alpha1_param_kind import V1alpha1ParamKind +from kubernetes_asyncio.client.models.v1alpha1_param_ref import V1alpha1ParamRef +from kubernetes_asyncio.client.models.v1alpha1_pod_group import V1alpha1PodGroup +from kubernetes_asyncio.client.models.v1alpha1_pod_group_policy import V1alpha1PodGroupPolicy +from kubernetes_asyncio.client.models.v1alpha1_server_storage_version import V1alpha1ServerStorageVersion +from kubernetes_asyncio.client.models.v1alpha1_storage_version import V1alpha1StorageVersion +from kubernetes_asyncio.client.models.v1alpha1_storage_version_condition import V1alpha1StorageVersionCondition +from kubernetes_asyncio.client.models.v1alpha1_storage_version_list import V1alpha1StorageVersionList +from kubernetes_asyncio.client.models.v1alpha1_storage_version_status import V1alpha1StorageVersionStatus +from kubernetes_asyncio.client.models.v1alpha1_typed_local_object_reference import V1alpha1TypedLocalObjectReference +from kubernetes_asyncio.client.models.v1alpha1_variable import V1alpha1Variable +from kubernetes_asyncio.client.models.v1alpha1_workload import V1alpha1Workload +from kubernetes_asyncio.client.models.v1alpha1_workload_list import V1alpha1WorkloadList +from kubernetes_asyncio.client.models.v1alpha1_workload_spec import V1alpha1WorkloadSpec +from kubernetes_asyncio.client.models.v1alpha2_lease_candidate import V1alpha2LeaseCandidate +from kubernetes_asyncio.client.models.v1alpha2_lease_candidate_list import V1alpha2LeaseCandidateList +from kubernetes_asyncio.client.models.v1alpha2_lease_candidate_spec import V1alpha2LeaseCandidateSpec +from kubernetes_asyncio.client.models.v1alpha3_device_taint import V1alpha3DeviceTaint +from kubernetes_asyncio.client.models.v1alpha3_device_taint_rule import V1alpha3DeviceTaintRule +from kubernetes_asyncio.client.models.v1alpha3_device_taint_rule_list import V1alpha3DeviceTaintRuleList +from kubernetes_asyncio.client.models.v1alpha3_device_taint_rule_spec import V1alpha3DeviceTaintRuleSpec +from kubernetes_asyncio.client.models.v1alpha3_device_taint_rule_status import V1alpha3DeviceTaintRuleStatus +from kubernetes_asyncio.client.models.v1alpha3_device_taint_selector import V1alpha3DeviceTaintSelector +from kubernetes_asyncio.client.models.v1beta1_allocated_device_status import V1beta1AllocatedDeviceStatus +from kubernetes_asyncio.client.models.v1beta1_allocation_result import V1beta1AllocationResult +from kubernetes_asyncio.client.models.v1beta1_apply_configuration import V1beta1ApplyConfiguration +from kubernetes_asyncio.client.models.v1beta1_basic_device import V1beta1BasicDevice +from kubernetes_asyncio.client.models.v1beta1_cel_device_selector import V1beta1CELDeviceSelector +from kubernetes_asyncio.client.models.v1beta1_capacity_request_policy import V1beta1CapacityRequestPolicy +from kubernetes_asyncio.client.models.v1beta1_capacity_request_policy_range import V1beta1CapacityRequestPolicyRange +from kubernetes_asyncio.client.models.v1beta1_capacity_requirements import V1beta1CapacityRequirements +from kubernetes_asyncio.client.models.v1beta1_cluster_trust_bundle import V1beta1ClusterTrustBundle +from kubernetes_asyncio.client.models.v1beta1_cluster_trust_bundle_list import V1beta1ClusterTrustBundleList +from kubernetes_asyncio.client.models.v1beta1_cluster_trust_bundle_spec import V1beta1ClusterTrustBundleSpec +from kubernetes_asyncio.client.models.v1beta1_counter import V1beta1Counter +from kubernetes_asyncio.client.models.v1beta1_counter_set import V1beta1CounterSet +from kubernetes_asyncio.client.models.v1beta1_device import V1beta1Device +from kubernetes_asyncio.client.models.v1beta1_device_allocation_configuration import V1beta1DeviceAllocationConfiguration +from kubernetes_asyncio.client.models.v1beta1_device_allocation_result import V1beta1DeviceAllocationResult +from kubernetes_asyncio.client.models.v1beta1_device_attribute import V1beta1DeviceAttribute +from kubernetes_asyncio.client.models.v1beta1_device_capacity import V1beta1DeviceCapacity +from kubernetes_asyncio.client.models.v1beta1_device_claim import V1beta1DeviceClaim +from kubernetes_asyncio.client.models.v1beta1_device_claim_configuration import V1beta1DeviceClaimConfiguration +from kubernetes_asyncio.client.models.v1beta1_device_class import V1beta1DeviceClass +from kubernetes_asyncio.client.models.v1beta1_device_class_configuration import V1beta1DeviceClassConfiguration +from kubernetes_asyncio.client.models.v1beta1_device_class_list import V1beta1DeviceClassList +from kubernetes_asyncio.client.models.v1beta1_device_class_spec import V1beta1DeviceClassSpec +from kubernetes_asyncio.client.models.v1beta1_device_constraint import V1beta1DeviceConstraint +from kubernetes_asyncio.client.models.v1beta1_device_counter_consumption import V1beta1DeviceCounterConsumption +from kubernetes_asyncio.client.models.v1beta1_device_request import V1beta1DeviceRequest +from kubernetes_asyncio.client.models.v1beta1_device_request_allocation_result import V1beta1DeviceRequestAllocationResult +from kubernetes_asyncio.client.models.v1beta1_device_selector import V1beta1DeviceSelector +from kubernetes_asyncio.client.models.v1beta1_device_sub_request import V1beta1DeviceSubRequest +from kubernetes_asyncio.client.models.v1beta1_device_taint import V1beta1DeviceTaint +from kubernetes_asyncio.client.models.v1beta1_device_toleration import V1beta1DeviceToleration +from kubernetes_asyncio.client.models.v1beta1_ip_address import V1beta1IPAddress +from kubernetes_asyncio.client.models.v1beta1_ip_address_list import V1beta1IPAddressList +from kubernetes_asyncio.client.models.v1beta1_ip_address_spec import V1beta1IPAddressSpec +from kubernetes_asyncio.client.models.v1beta1_json_patch import V1beta1JSONPatch +from kubernetes_asyncio.client.models.v1beta1_lease_candidate import V1beta1LeaseCandidate +from kubernetes_asyncio.client.models.v1beta1_lease_candidate_list import V1beta1LeaseCandidateList +from kubernetes_asyncio.client.models.v1beta1_lease_candidate_spec import V1beta1LeaseCandidateSpec +from kubernetes_asyncio.client.models.v1beta1_match_condition import V1beta1MatchCondition +from kubernetes_asyncio.client.models.v1beta1_match_resources import V1beta1MatchResources +from kubernetes_asyncio.client.models.v1beta1_mutating_admission_policy import V1beta1MutatingAdmissionPolicy +from kubernetes_asyncio.client.models.v1beta1_mutating_admission_policy_binding import V1beta1MutatingAdmissionPolicyBinding +from kubernetes_asyncio.client.models.v1beta1_mutating_admission_policy_binding_list import V1beta1MutatingAdmissionPolicyBindingList +from kubernetes_asyncio.client.models.v1beta1_mutating_admission_policy_binding_spec import V1beta1MutatingAdmissionPolicyBindingSpec +from kubernetes_asyncio.client.models.v1beta1_mutating_admission_policy_list import V1beta1MutatingAdmissionPolicyList +from kubernetes_asyncio.client.models.v1beta1_mutating_admission_policy_spec import V1beta1MutatingAdmissionPolicySpec +from kubernetes_asyncio.client.models.v1beta1_mutation import V1beta1Mutation +from kubernetes_asyncio.client.models.v1beta1_named_rule_with_operations import V1beta1NamedRuleWithOperations +from kubernetes_asyncio.client.models.v1beta1_network_device_data import V1beta1NetworkDeviceData +from kubernetes_asyncio.client.models.v1beta1_opaque_device_configuration import V1beta1OpaqueDeviceConfiguration +from kubernetes_asyncio.client.models.v1beta1_param_kind import V1beta1ParamKind +from kubernetes_asyncio.client.models.v1beta1_param_ref import V1beta1ParamRef +from kubernetes_asyncio.client.models.v1beta1_parent_reference import V1beta1ParentReference +from kubernetes_asyncio.client.models.v1beta1_pod_certificate_request import V1beta1PodCertificateRequest +from kubernetes_asyncio.client.models.v1beta1_pod_certificate_request_list import V1beta1PodCertificateRequestList +from kubernetes_asyncio.client.models.v1beta1_pod_certificate_request_spec import V1beta1PodCertificateRequestSpec +from kubernetes_asyncio.client.models.v1beta1_pod_certificate_request_status import V1beta1PodCertificateRequestStatus +from kubernetes_asyncio.client.models.v1beta1_resource_claim import V1beta1ResourceClaim +from kubernetes_asyncio.client.models.v1beta1_resource_claim_consumer_reference import V1beta1ResourceClaimConsumerReference +from kubernetes_asyncio.client.models.v1beta1_resource_claim_list import V1beta1ResourceClaimList +from kubernetes_asyncio.client.models.v1beta1_resource_claim_spec import V1beta1ResourceClaimSpec +from kubernetes_asyncio.client.models.v1beta1_resource_claim_status import V1beta1ResourceClaimStatus +from kubernetes_asyncio.client.models.v1beta1_resource_claim_template import V1beta1ResourceClaimTemplate +from kubernetes_asyncio.client.models.v1beta1_resource_claim_template_list import V1beta1ResourceClaimTemplateList +from kubernetes_asyncio.client.models.v1beta1_resource_claim_template_spec import V1beta1ResourceClaimTemplateSpec +from kubernetes_asyncio.client.models.v1beta1_resource_pool import V1beta1ResourcePool +from kubernetes_asyncio.client.models.v1beta1_resource_slice import V1beta1ResourceSlice +from kubernetes_asyncio.client.models.v1beta1_resource_slice_list import V1beta1ResourceSliceList +from kubernetes_asyncio.client.models.v1beta1_resource_slice_spec import V1beta1ResourceSliceSpec +from kubernetes_asyncio.client.models.v1beta1_service_cidr import V1beta1ServiceCIDR +from kubernetes_asyncio.client.models.v1beta1_service_cidr_list import V1beta1ServiceCIDRList +from kubernetes_asyncio.client.models.v1beta1_service_cidr_spec import V1beta1ServiceCIDRSpec +from kubernetes_asyncio.client.models.v1beta1_service_cidr_status import V1beta1ServiceCIDRStatus +from kubernetes_asyncio.client.models.v1beta1_storage_version_migration import V1beta1StorageVersionMigration +from kubernetes_asyncio.client.models.v1beta1_storage_version_migration_list import V1beta1StorageVersionMigrationList +from kubernetes_asyncio.client.models.v1beta1_storage_version_migration_spec import V1beta1StorageVersionMigrationSpec +from kubernetes_asyncio.client.models.v1beta1_storage_version_migration_status import V1beta1StorageVersionMigrationStatus +from kubernetes_asyncio.client.models.v1beta1_variable import V1beta1Variable +from kubernetes_asyncio.client.models.v1beta1_volume_attributes_class import V1beta1VolumeAttributesClass +from kubernetes_asyncio.client.models.v1beta1_volume_attributes_class_list import V1beta1VolumeAttributesClassList +from kubernetes_asyncio.client.models.v1beta2_allocated_device_status import V1beta2AllocatedDeviceStatus +from kubernetes_asyncio.client.models.v1beta2_allocation_result import V1beta2AllocationResult +from kubernetes_asyncio.client.models.v1beta2_cel_device_selector import V1beta2CELDeviceSelector +from kubernetes_asyncio.client.models.v1beta2_capacity_request_policy import V1beta2CapacityRequestPolicy +from kubernetes_asyncio.client.models.v1beta2_capacity_request_policy_range import V1beta2CapacityRequestPolicyRange +from kubernetes_asyncio.client.models.v1beta2_capacity_requirements import V1beta2CapacityRequirements +from kubernetes_asyncio.client.models.v1beta2_counter import V1beta2Counter +from kubernetes_asyncio.client.models.v1beta2_counter_set import V1beta2CounterSet +from kubernetes_asyncio.client.models.v1beta2_device import V1beta2Device +from kubernetes_asyncio.client.models.v1beta2_device_allocation_configuration import V1beta2DeviceAllocationConfiguration +from kubernetes_asyncio.client.models.v1beta2_device_allocation_result import V1beta2DeviceAllocationResult +from kubernetes_asyncio.client.models.v1beta2_device_attribute import V1beta2DeviceAttribute +from kubernetes_asyncio.client.models.v1beta2_device_capacity import V1beta2DeviceCapacity +from kubernetes_asyncio.client.models.v1beta2_device_claim import V1beta2DeviceClaim +from kubernetes_asyncio.client.models.v1beta2_device_claim_configuration import V1beta2DeviceClaimConfiguration +from kubernetes_asyncio.client.models.v1beta2_device_class import V1beta2DeviceClass +from kubernetes_asyncio.client.models.v1beta2_device_class_configuration import V1beta2DeviceClassConfiguration +from kubernetes_asyncio.client.models.v1beta2_device_class_list import V1beta2DeviceClassList +from kubernetes_asyncio.client.models.v1beta2_device_class_spec import V1beta2DeviceClassSpec +from kubernetes_asyncio.client.models.v1beta2_device_constraint import V1beta2DeviceConstraint +from kubernetes_asyncio.client.models.v1beta2_device_counter_consumption import V1beta2DeviceCounterConsumption +from kubernetes_asyncio.client.models.v1beta2_device_request import V1beta2DeviceRequest +from kubernetes_asyncio.client.models.v1beta2_device_request_allocation_result import V1beta2DeviceRequestAllocationResult +from kubernetes_asyncio.client.models.v1beta2_device_selector import V1beta2DeviceSelector +from kubernetes_asyncio.client.models.v1beta2_device_sub_request import V1beta2DeviceSubRequest +from kubernetes_asyncio.client.models.v1beta2_device_taint import V1beta2DeviceTaint +from kubernetes_asyncio.client.models.v1beta2_device_toleration import V1beta2DeviceToleration +from kubernetes_asyncio.client.models.v1beta2_exact_device_request import V1beta2ExactDeviceRequest +from kubernetes_asyncio.client.models.v1beta2_network_device_data import V1beta2NetworkDeviceData +from kubernetes_asyncio.client.models.v1beta2_opaque_device_configuration import V1beta2OpaqueDeviceConfiguration +from kubernetes_asyncio.client.models.v1beta2_resource_claim import V1beta2ResourceClaim +from kubernetes_asyncio.client.models.v1beta2_resource_claim_consumer_reference import V1beta2ResourceClaimConsumerReference +from kubernetes_asyncio.client.models.v1beta2_resource_claim_list import V1beta2ResourceClaimList +from kubernetes_asyncio.client.models.v1beta2_resource_claim_spec import V1beta2ResourceClaimSpec +from kubernetes_asyncio.client.models.v1beta2_resource_claim_status import V1beta2ResourceClaimStatus +from kubernetes_asyncio.client.models.v1beta2_resource_claim_template import V1beta2ResourceClaimTemplate +from kubernetes_asyncio.client.models.v1beta2_resource_claim_template_list import V1beta2ResourceClaimTemplateList +from kubernetes_asyncio.client.models.v1beta2_resource_claim_template_spec import V1beta2ResourceClaimTemplateSpec +from kubernetes_asyncio.client.models.v1beta2_resource_pool import V1beta2ResourcePool +from kubernetes_asyncio.client.models.v1beta2_resource_slice import V1beta2ResourceSlice +from kubernetes_asyncio.client.models.v1beta2_resource_slice_list import V1beta2ResourceSliceList +from kubernetes_asyncio.client.models.v1beta2_resource_slice_spec import V1beta2ResourceSliceSpec +from kubernetes_asyncio.client.models.v2_api_group_discovery import V2APIGroupDiscovery +from kubernetes_asyncio.client.models.v2_api_group_discovery_list import V2APIGroupDiscoveryList +from kubernetes_asyncio.client.models.v2_api_resource_discovery import V2APIResourceDiscovery +from kubernetes_asyncio.client.models.v2_api_subresource_discovery import V2APISubresourceDiscovery +from kubernetes_asyncio.client.models.v2_api_version_discovery import V2APIVersionDiscovery +from kubernetes_asyncio.client.models.v2_container_resource_metric_source import V2ContainerResourceMetricSource +from kubernetes_asyncio.client.models.v2_container_resource_metric_status import V2ContainerResourceMetricStatus +from kubernetes_asyncio.client.models.v2_cross_version_object_reference import V2CrossVersionObjectReference +from kubernetes_asyncio.client.models.v2_external_metric_source import V2ExternalMetricSource +from kubernetes_asyncio.client.models.v2_external_metric_status import V2ExternalMetricStatus +from kubernetes_asyncio.client.models.v2_hpa_scaling_policy import V2HPAScalingPolicy +from kubernetes_asyncio.client.models.v2_hpa_scaling_rules import V2HPAScalingRules +from kubernetes_asyncio.client.models.v2_horizontal_pod_autoscaler import V2HorizontalPodAutoscaler +from kubernetes_asyncio.client.models.v2_horizontal_pod_autoscaler_behavior import V2HorizontalPodAutoscalerBehavior +from kubernetes_asyncio.client.models.v2_horizontal_pod_autoscaler_condition import V2HorizontalPodAutoscalerCondition +from kubernetes_asyncio.client.models.v2_horizontal_pod_autoscaler_list import V2HorizontalPodAutoscalerList +from kubernetes_asyncio.client.models.v2_horizontal_pod_autoscaler_spec import V2HorizontalPodAutoscalerSpec +from kubernetes_asyncio.client.models.v2_horizontal_pod_autoscaler_status import V2HorizontalPodAutoscalerStatus +from kubernetes_asyncio.client.models.v2_metric_identifier import V2MetricIdentifier +from kubernetes_asyncio.client.models.v2_metric_spec import V2MetricSpec +from kubernetes_asyncio.client.models.v2_metric_status import V2MetricStatus +from kubernetes_asyncio.client.models.v2_metric_target import V2MetricTarget +from kubernetes_asyncio.client.models.v2_metric_value_status import V2MetricValueStatus +from kubernetes_asyncio.client.models.v2_object_metric_source import V2ObjectMetricSource +from kubernetes_asyncio.client.models.v2_object_metric_status import V2ObjectMetricStatus +from kubernetes_asyncio.client.models.v2_pods_metric_source import V2PodsMetricSource +from kubernetes_asyncio.client.models.v2_pods_metric_status import V2PodsMetricStatus +from kubernetes_asyncio.client.models.v2_resource_metric_source import V2ResourceMetricSource +from kubernetes_asyncio.client.models.v2_resource_metric_status import V2ResourceMetricStatus +from kubernetes_asyncio.client.models.v2beta1_api_group_discovery import V2beta1APIGroupDiscovery +from kubernetes_asyncio.client.models.v2beta1_api_group_discovery_list import V2beta1APIGroupDiscoveryList +from kubernetes_asyncio.client.models.v2beta1_api_resource_discovery import V2beta1APIResourceDiscovery +from kubernetes_asyncio.client.models.v2beta1_api_subresource_discovery import V2beta1APISubresourceDiscovery +from kubernetes_asyncio.client.models.v2beta1_api_version_discovery import V2beta1APIVersionDiscovery +from kubernetes_asyncio.client.models.version_info import VersionInfo diff --git a/kubernetes_asyncio/client/models/admissionregistration_v1_service_reference.py b/kubernetes_asyncio/client/models/admissionregistration_v1_service_reference.py new file mode 100644 index 0000000000..ddc5cfd6de --- /dev/null +++ b/kubernetes_asyncio/client/models/admissionregistration_v1_service_reference.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class AdmissionregistrationV1ServiceReference(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str', + 'namespace': 'str', + 'path': 'str', + 'port': 'int' + } + + attribute_map = { + 'name': 'name', + 'namespace': 'namespace', + 'path': 'path', + 'port': 'port' + } + + def __init__(self, name=None, namespace=None, path=None, port=None, local_vars_configuration=None): # noqa: E501 + """AdmissionregistrationV1ServiceReference - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._name = None + self._namespace = None + self._path = None + self._port = None + self.discriminator = None + + self.name = name + self.namespace = namespace + if path is not None: + self.path = path + if port is not None: + self.port = port + + @property + def name(self): + """Gets the name of this AdmissionregistrationV1ServiceReference. # noqa: E501 + + `name` is the name of the service. Required # noqa: E501 + + :return: The name of this AdmissionregistrationV1ServiceReference. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this AdmissionregistrationV1ServiceReference. + + `name` is the name of the service. Required # noqa: E501 + + :param name: The name of this AdmissionregistrationV1ServiceReference. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def namespace(self): + """Gets the namespace of this AdmissionregistrationV1ServiceReference. # noqa: E501 + + `namespace` is the namespace of the service. Required # noqa: E501 + + :return: The namespace of this AdmissionregistrationV1ServiceReference. # noqa: E501 + :rtype: str + """ + return self._namespace + + @namespace.setter + def namespace(self, namespace): + """Sets the namespace of this AdmissionregistrationV1ServiceReference. + + `namespace` is the namespace of the service. Required # noqa: E501 + + :param namespace: The namespace of this AdmissionregistrationV1ServiceReference. # noqa: E501 + :type namespace: str + """ + if self.local_vars_configuration.client_side_validation and namespace is None: # noqa: E501 + raise ValueError("Invalid value for `namespace`, must not be `None`") # noqa: E501 + + self._namespace = namespace + + @property + def path(self): + """Gets the path of this AdmissionregistrationV1ServiceReference. # noqa: E501 + + `path` is an optional URL path which will be sent in any request to this service. # noqa: E501 + + :return: The path of this AdmissionregistrationV1ServiceReference. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this AdmissionregistrationV1ServiceReference. + + `path` is an optional URL path which will be sent in any request to this service. # noqa: E501 + + :param path: The path of this AdmissionregistrationV1ServiceReference. # noqa: E501 + :type path: str + """ + + self._path = path + + @property + def port(self): + """Gets the port of this AdmissionregistrationV1ServiceReference. # noqa: E501 + + If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive). # noqa: E501 + + :return: The port of this AdmissionregistrationV1ServiceReference. # noqa: E501 + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """Sets the port of this AdmissionregistrationV1ServiceReference. + + If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive). # noqa: E501 + + :param port: The port of this AdmissionregistrationV1ServiceReference. # noqa: E501 + :type port: int + """ + + self._port = port + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdmissionregistrationV1ServiceReference): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AdmissionregistrationV1ServiceReference): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/admissionregistration_v1_webhook_client_config.py b/kubernetes_asyncio/client/models/admissionregistration_v1_webhook_client_config.py new file mode 100644 index 0000000000..edcfc0136b --- /dev/null +++ b/kubernetes_asyncio/client/models/admissionregistration_v1_webhook_client_config.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class AdmissionregistrationV1WebhookClientConfig(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'ca_bundle': 'str', + 'service': 'AdmissionregistrationV1ServiceReference', + 'url': 'str' + } + + attribute_map = { + 'ca_bundle': 'caBundle', + 'service': 'service', + 'url': 'url' + } + + def __init__(self, ca_bundle=None, service=None, url=None, local_vars_configuration=None): # noqa: E501 + """AdmissionregistrationV1WebhookClientConfig - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._ca_bundle = None + self._service = None + self._url = None + self.discriminator = None + + if ca_bundle is not None: + self.ca_bundle = ca_bundle + if service is not None: + self.service = service + if url is not None: + self.url = url + + @property + def ca_bundle(self): + """Gets the ca_bundle of this AdmissionregistrationV1WebhookClientConfig. # noqa: E501 + + `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used. # noqa: E501 + + :return: The ca_bundle of this AdmissionregistrationV1WebhookClientConfig. # noqa: E501 + :rtype: str + """ + return self._ca_bundle + + @ca_bundle.setter + def ca_bundle(self, ca_bundle): + """Sets the ca_bundle of this AdmissionregistrationV1WebhookClientConfig. + + `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used. # noqa: E501 + + :param ca_bundle: The ca_bundle of this AdmissionregistrationV1WebhookClientConfig. # noqa: E501 + :type ca_bundle: str + """ + if (self.local_vars_configuration.client_side_validation and + ca_bundle is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', ca_bundle)): # noqa: E501 + raise ValueError(r"Invalid value for `ca_bundle`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 + + self._ca_bundle = ca_bundle + + @property + def service(self): + """Gets the service of this AdmissionregistrationV1WebhookClientConfig. # noqa: E501 + + + :return: The service of this AdmissionregistrationV1WebhookClientConfig. # noqa: E501 + :rtype: AdmissionregistrationV1ServiceReference + """ + return self._service + + @service.setter + def service(self, service): + """Sets the service of this AdmissionregistrationV1WebhookClientConfig. + + + :param service: The service of this AdmissionregistrationV1WebhookClientConfig. # noqa: E501 + :type service: AdmissionregistrationV1ServiceReference + """ + + self._service = service + + @property + def url(self): + """Gets the url of this AdmissionregistrationV1WebhookClientConfig. # noqa: E501 + + `url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified. The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address. Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster. The scheme must be \"https\"; the URL must begin with \"https://\". A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier. Attempting to use a user or basic auth e.g. \"user:password@\" is not allowed. Fragments (\"#...\") and query parameters (\"?...\") are not allowed, either. # noqa: E501 + + :return: The url of this AdmissionregistrationV1WebhookClientConfig. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this AdmissionregistrationV1WebhookClientConfig. + + `url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified. The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address. Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster. The scheme must be \"https\"; the URL must begin with \"https://\". A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier. Attempting to use a user or basic auth e.g. \"user:password@\" is not allowed. Fragments (\"#...\") and query parameters (\"?...\") are not allowed, either. # noqa: E501 + + :param url: The url of this AdmissionregistrationV1WebhookClientConfig. # noqa: E501 + :type url: str + """ + + self._url = url + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdmissionregistrationV1WebhookClientConfig): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AdmissionregistrationV1WebhookClientConfig): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/apiextensions_v1_service_reference.py b/kubernetes_asyncio/client/models/apiextensions_v1_service_reference.py new file mode 100644 index 0000000000..ea388427a4 --- /dev/null +++ b/kubernetes_asyncio/client/models/apiextensions_v1_service_reference.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class ApiextensionsV1ServiceReference(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str', + 'namespace': 'str', + 'path': 'str', + 'port': 'int' + } + + attribute_map = { + 'name': 'name', + 'namespace': 'namespace', + 'path': 'path', + 'port': 'port' + } + + def __init__(self, name=None, namespace=None, path=None, port=None, local_vars_configuration=None): # noqa: E501 + """ApiextensionsV1ServiceReference - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._name = None + self._namespace = None + self._path = None + self._port = None + self.discriminator = None + + self.name = name + self.namespace = namespace + if path is not None: + self.path = path + if port is not None: + self.port = port + + @property + def name(self): + """Gets the name of this ApiextensionsV1ServiceReference. # noqa: E501 + + name is the name of the service. Required # noqa: E501 + + :return: The name of this ApiextensionsV1ServiceReference. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ApiextensionsV1ServiceReference. + + name is the name of the service. Required # noqa: E501 + + :param name: The name of this ApiextensionsV1ServiceReference. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def namespace(self): + """Gets the namespace of this ApiextensionsV1ServiceReference. # noqa: E501 + + namespace is the namespace of the service. Required # noqa: E501 + + :return: The namespace of this ApiextensionsV1ServiceReference. # noqa: E501 + :rtype: str + """ + return self._namespace + + @namespace.setter + def namespace(self, namespace): + """Sets the namespace of this ApiextensionsV1ServiceReference. + + namespace is the namespace of the service. Required # noqa: E501 + + :param namespace: The namespace of this ApiextensionsV1ServiceReference. # noqa: E501 + :type namespace: str + """ + if self.local_vars_configuration.client_side_validation and namespace is None: # noqa: E501 + raise ValueError("Invalid value for `namespace`, must not be `None`") # noqa: E501 + + self._namespace = namespace + + @property + def path(self): + """Gets the path of this ApiextensionsV1ServiceReference. # noqa: E501 + + path is an optional URL path at which the webhook will be contacted. # noqa: E501 + + :return: The path of this ApiextensionsV1ServiceReference. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this ApiextensionsV1ServiceReference. + + path is an optional URL path at which the webhook will be contacted. # noqa: E501 + + :param path: The path of this ApiextensionsV1ServiceReference. # noqa: E501 + :type path: str + """ + + self._path = path + + @property + def port(self): + """Gets the port of this ApiextensionsV1ServiceReference. # noqa: E501 + + port is an optional service port at which the webhook will be contacted. `port` should be a valid port number (1-65535, inclusive). Defaults to 443 for backward compatibility. # noqa: E501 + + :return: The port of this ApiextensionsV1ServiceReference. # noqa: E501 + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """Sets the port of this ApiextensionsV1ServiceReference. + + port is an optional service port at which the webhook will be contacted. `port` should be a valid port number (1-65535, inclusive). Defaults to 443 for backward compatibility. # noqa: E501 + + :param port: The port of this ApiextensionsV1ServiceReference. # noqa: E501 + :type port: int + """ + + self._port = port + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiextensionsV1ServiceReference): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiextensionsV1ServiceReference): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/apiextensions_v1_webhook_client_config.py b/kubernetes_asyncio/client/models/apiextensions_v1_webhook_client_config.py new file mode 100644 index 0000000000..dd642d7ca2 --- /dev/null +++ b/kubernetes_asyncio/client/models/apiextensions_v1_webhook_client_config.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class ApiextensionsV1WebhookClientConfig(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'ca_bundle': 'str', + 'service': 'ApiextensionsV1ServiceReference', + 'url': 'str' + } + + attribute_map = { + 'ca_bundle': 'caBundle', + 'service': 'service', + 'url': 'url' + } + + def __init__(self, ca_bundle=None, service=None, url=None, local_vars_configuration=None): # noqa: E501 + """ApiextensionsV1WebhookClientConfig - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._ca_bundle = None + self._service = None + self._url = None + self.discriminator = None + + if ca_bundle is not None: + self.ca_bundle = ca_bundle + if service is not None: + self.service = service + if url is not None: + self.url = url + + @property + def ca_bundle(self): + """Gets the ca_bundle of this ApiextensionsV1WebhookClientConfig. # noqa: E501 + + caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used. # noqa: E501 + + :return: The ca_bundle of this ApiextensionsV1WebhookClientConfig. # noqa: E501 + :rtype: str + """ + return self._ca_bundle + + @ca_bundle.setter + def ca_bundle(self, ca_bundle): + """Sets the ca_bundle of this ApiextensionsV1WebhookClientConfig. + + caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used. # noqa: E501 + + :param ca_bundle: The ca_bundle of this ApiextensionsV1WebhookClientConfig. # noqa: E501 + :type ca_bundle: str + """ + if (self.local_vars_configuration.client_side_validation and + ca_bundle is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', ca_bundle)): # noqa: E501 + raise ValueError(r"Invalid value for `ca_bundle`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 + + self._ca_bundle = ca_bundle + + @property + def service(self): + """Gets the service of this ApiextensionsV1WebhookClientConfig. # noqa: E501 + + + :return: The service of this ApiextensionsV1WebhookClientConfig. # noqa: E501 + :rtype: ApiextensionsV1ServiceReference + """ + return self._service + + @service.setter + def service(self, service): + """Sets the service of this ApiextensionsV1WebhookClientConfig. + + + :param service: The service of this ApiextensionsV1WebhookClientConfig. # noqa: E501 + :type service: ApiextensionsV1ServiceReference + """ + + self._service = service + + @property + def url(self): + """Gets the url of this ApiextensionsV1WebhookClientConfig. # noqa: E501 + + url gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified. The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address. Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster. The scheme must be \"https\"; the URL must begin with \"https://\". A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier. Attempting to use a user or basic auth e.g. \"user:password@\" is not allowed. Fragments (\"#...\") and query parameters (\"?...\") are not allowed, either. # noqa: E501 + + :return: The url of this ApiextensionsV1WebhookClientConfig. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this ApiextensionsV1WebhookClientConfig. + + url gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified. The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address. Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster. The scheme must be \"https\"; the URL must begin with \"https://\". A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier. Attempting to use a user or basic auth e.g. \"user:password@\" is not allowed. Fragments (\"#...\") and query parameters (\"?...\") are not allowed, either. # noqa: E501 + + :param url: The url of this ApiextensionsV1WebhookClientConfig. # noqa: E501 + :type url: str + """ + + self._url = url + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiextensionsV1WebhookClientConfig): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiextensionsV1WebhookClientConfig): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/apiregistration_v1_service_reference.py b/kubernetes_asyncio/client/models/apiregistration_v1_service_reference.py new file mode 100644 index 0000000000..39d4a984d7 --- /dev/null +++ b/kubernetes_asyncio/client/models/apiregistration_v1_service_reference.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class ApiregistrationV1ServiceReference(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str', + 'namespace': 'str', + 'port': 'int' + } + + attribute_map = { + 'name': 'name', + 'namespace': 'namespace', + 'port': 'port' + } + + def __init__(self, name=None, namespace=None, port=None, local_vars_configuration=None): # noqa: E501 + """ApiregistrationV1ServiceReference - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._name = None + self._namespace = None + self._port = None + self.discriminator = None + + if name is not None: + self.name = name + if namespace is not None: + self.namespace = namespace + if port is not None: + self.port = port + + @property + def name(self): + """Gets the name of this ApiregistrationV1ServiceReference. # noqa: E501 + + Name is the name of the service # noqa: E501 + + :return: The name of this ApiregistrationV1ServiceReference. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ApiregistrationV1ServiceReference. + + Name is the name of the service # noqa: E501 + + :param name: The name of this ApiregistrationV1ServiceReference. # noqa: E501 + :type name: str + """ + + self._name = name + + @property + def namespace(self): + """Gets the namespace of this ApiregistrationV1ServiceReference. # noqa: E501 + + Namespace is the namespace of the service # noqa: E501 + + :return: The namespace of this ApiregistrationV1ServiceReference. # noqa: E501 + :rtype: str + """ + return self._namespace + + @namespace.setter + def namespace(self, namespace): + """Sets the namespace of this ApiregistrationV1ServiceReference. + + Namespace is the namespace of the service # noqa: E501 + + :param namespace: The namespace of this ApiregistrationV1ServiceReference. # noqa: E501 + :type namespace: str + """ + + self._namespace = namespace + + @property + def port(self): + """Gets the port of this ApiregistrationV1ServiceReference. # noqa: E501 + + If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive). # noqa: E501 + + :return: The port of this ApiregistrationV1ServiceReference. # noqa: E501 + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """Sets the port of this ApiregistrationV1ServiceReference. + + If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive). # noqa: E501 + + :param port: The port of this ApiregistrationV1ServiceReference. # noqa: E501 + :type port: int + """ + + self._port = port + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ApiregistrationV1ServiceReference): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ApiregistrationV1ServiceReference): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/authentication_v1_token_request.py b/kubernetes_asyncio/client/models/authentication_v1_token_request.py new file mode 100644 index 0000000000..9ba60ee777 --- /dev/null +++ b/kubernetes_asyncio/client/models/authentication_v1_token_request.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class AuthenticationV1TokenRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'spec': 'V1TokenRequestSpec', + 'status': 'V1TokenRequestStatus' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'spec': 'spec', + 'status': 'status' + } + + def __init__(self, api_version=None, kind=None, metadata=None, spec=None, status=None, local_vars_configuration=None): # noqa: E501 + """AuthenticationV1TokenRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._metadata = None + self._spec = None + self._status = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + self.spec = spec + if status is not None: + self.status = status + + @property + def api_version(self): + """Gets the api_version of this AuthenticationV1TokenRequest. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this AuthenticationV1TokenRequest. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this AuthenticationV1TokenRequest. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this AuthenticationV1TokenRequest. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this AuthenticationV1TokenRequest. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this AuthenticationV1TokenRequest. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this AuthenticationV1TokenRequest. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this AuthenticationV1TokenRequest. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this AuthenticationV1TokenRequest. # noqa: E501 + + + :return: The metadata of this AuthenticationV1TokenRequest. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this AuthenticationV1TokenRequest. + + + :param metadata: The metadata of this AuthenticationV1TokenRequest. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def spec(self): + """Gets the spec of this AuthenticationV1TokenRequest. # noqa: E501 + + + :return: The spec of this AuthenticationV1TokenRequest. # noqa: E501 + :rtype: V1TokenRequestSpec + """ + return self._spec + + @spec.setter + def spec(self, spec): + """Sets the spec of this AuthenticationV1TokenRequest. + + + :param spec: The spec of this AuthenticationV1TokenRequest. # noqa: E501 + :type spec: V1TokenRequestSpec + """ + if self.local_vars_configuration.client_side_validation and spec is None: # noqa: E501 + raise ValueError("Invalid value for `spec`, must not be `None`") # noqa: E501 + + self._spec = spec + + @property + def status(self): + """Gets the status of this AuthenticationV1TokenRequest. # noqa: E501 + + + :return: The status of this AuthenticationV1TokenRequest. # noqa: E501 + :rtype: V1TokenRequestStatus + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this AuthenticationV1TokenRequest. + + + :param status: The status of this AuthenticationV1TokenRequest. # noqa: E501 + :type status: V1TokenRequestStatus + """ + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AuthenticationV1TokenRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, AuthenticationV1TokenRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/core_v1_endpoint_port.py b/kubernetes_asyncio/client/models/core_v1_endpoint_port.py new file mode 100644 index 0000000000..23093498dd --- /dev/null +++ b/kubernetes_asyncio/client/models/core_v1_endpoint_port.py @@ -0,0 +1,218 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class CoreV1EndpointPort(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'app_protocol': 'str', + 'name': 'str', + 'port': 'int', + 'protocol': 'str' + } + + attribute_map = { + 'app_protocol': 'appProtocol', + 'name': 'name', + 'port': 'port', + 'protocol': 'protocol' + } + + def __init__(self, app_protocol=None, name=None, port=None, protocol=None, local_vars_configuration=None): # noqa: E501 + """CoreV1EndpointPort - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._app_protocol = None + self._name = None + self._port = None + self._protocol = None + self.discriminator = None + + if app_protocol is not None: + self.app_protocol = app_protocol + if name is not None: + self.name = name + self.port = port + if protocol is not None: + self.protocol = protocol + + @property + def app_protocol(self): + """Gets the app_protocol of this CoreV1EndpointPort. # noqa: E501 + + The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either: * Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 * Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol. # noqa: E501 + + :return: The app_protocol of this CoreV1EndpointPort. # noqa: E501 + :rtype: str + """ + return self._app_protocol + + @app_protocol.setter + def app_protocol(self, app_protocol): + """Sets the app_protocol of this CoreV1EndpointPort. + + The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either: * Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 * Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol. # noqa: E501 + + :param app_protocol: The app_protocol of this CoreV1EndpointPort. # noqa: E501 + :type app_protocol: str + """ + + self._app_protocol = app_protocol + + @property + def name(self): + """Gets the name of this CoreV1EndpointPort. # noqa: E501 + + The name of this port. This must match the 'name' field in the corresponding ServicePort. Must be a DNS_LABEL. Optional only if one port is defined. # noqa: E501 + + :return: The name of this CoreV1EndpointPort. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CoreV1EndpointPort. + + The name of this port. This must match the 'name' field in the corresponding ServicePort. Must be a DNS_LABEL. Optional only if one port is defined. # noqa: E501 + + :param name: The name of this CoreV1EndpointPort. # noqa: E501 + :type name: str + """ + + self._name = name + + @property + def port(self): + """Gets the port of this CoreV1EndpointPort. # noqa: E501 + + The port number of the endpoint. # noqa: E501 + + :return: The port of this CoreV1EndpointPort. # noqa: E501 + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """Sets the port of this CoreV1EndpointPort. + + The port number of the endpoint. # noqa: E501 + + :param port: The port of this CoreV1EndpointPort. # noqa: E501 + :type port: int + """ + if self.local_vars_configuration.client_side_validation and port is None: # noqa: E501 + raise ValueError("Invalid value for `port`, must not be `None`") # noqa: E501 + + self._port = port + + @property + def protocol(self): + """Gets the protocol of this CoreV1EndpointPort. # noqa: E501 + + The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP. # noqa: E501 + + :return: The protocol of this CoreV1EndpointPort. # noqa: E501 + :rtype: str + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol): + """Sets the protocol of this CoreV1EndpointPort. + + The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP. # noqa: E501 + + :param protocol: The protocol of this CoreV1EndpointPort. # noqa: E501 + :type protocol: str + """ + + self._protocol = protocol + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CoreV1EndpointPort): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CoreV1EndpointPort): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/core_v1_event.py b/kubernetes_asyncio/client/models/core_v1_event.py new file mode 100644 index 0000000000..9109d52d32 --- /dev/null +++ b/kubernetes_asyncio/client/models/core_v1_event.py @@ -0,0 +1,573 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class CoreV1Event(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'action': 'str', + 'api_version': 'str', + 'count': 'int', + 'event_time': 'datetime', + 'first_timestamp': 'datetime', + 'involved_object': 'V1ObjectReference', + 'kind': 'str', + 'last_timestamp': 'datetime', + 'message': 'str', + 'metadata': 'V1ObjectMeta', + 'reason': 'str', + 'related': 'V1ObjectReference', + 'reporting_component': 'str', + 'reporting_instance': 'str', + 'series': 'CoreV1EventSeries', + 'source': 'V1EventSource', + 'type': 'str' + } + + attribute_map = { + 'action': 'action', + 'api_version': 'apiVersion', + 'count': 'count', + 'event_time': 'eventTime', + 'first_timestamp': 'firstTimestamp', + 'involved_object': 'involvedObject', + 'kind': 'kind', + 'last_timestamp': 'lastTimestamp', + 'message': 'message', + 'metadata': 'metadata', + 'reason': 'reason', + 'related': 'related', + 'reporting_component': 'reportingComponent', + 'reporting_instance': 'reportingInstance', + 'series': 'series', + 'source': 'source', + 'type': 'type' + } + + def __init__(self, action=None, api_version=None, count=None, event_time=None, first_timestamp=None, involved_object=None, kind=None, last_timestamp=None, message=None, metadata=None, reason=None, related=None, reporting_component=None, reporting_instance=None, series=None, source=None, type=None, local_vars_configuration=None): # noqa: E501 + """CoreV1Event - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._action = None + self._api_version = None + self._count = None + self._event_time = None + self._first_timestamp = None + self._involved_object = None + self._kind = None + self._last_timestamp = None + self._message = None + self._metadata = None + self._reason = None + self._related = None + self._reporting_component = None + self._reporting_instance = None + self._series = None + self._source = None + self._type = None + self.discriminator = None + + if action is not None: + self.action = action + if api_version is not None: + self.api_version = api_version + if count is not None: + self.count = count + if event_time is not None: + self.event_time = event_time + if first_timestamp is not None: + self.first_timestamp = first_timestamp + self.involved_object = involved_object + if kind is not None: + self.kind = kind + if last_timestamp is not None: + self.last_timestamp = last_timestamp + if message is not None: + self.message = message + self.metadata = metadata + if reason is not None: + self.reason = reason + if related is not None: + self.related = related + if reporting_component is not None: + self.reporting_component = reporting_component + if reporting_instance is not None: + self.reporting_instance = reporting_instance + if series is not None: + self.series = series + if source is not None: + self.source = source + if type is not None: + self.type = type + + @property + def action(self): + """Gets the action of this CoreV1Event. # noqa: E501 + + What action was taken/failed regarding to the Regarding object. # noqa: E501 + + :return: The action of this CoreV1Event. # noqa: E501 + :rtype: str + """ + return self._action + + @action.setter + def action(self, action): + """Sets the action of this CoreV1Event. + + What action was taken/failed regarding to the Regarding object. # noqa: E501 + + :param action: The action of this CoreV1Event. # noqa: E501 + :type action: str + """ + + self._action = action + + @property + def api_version(self): + """Gets the api_version of this CoreV1Event. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this CoreV1Event. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this CoreV1Event. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this CoreV1Event. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def count(self): + """Gets the count of this CoreV1Event. # noqa: E501 + + The number of times this event has occurred. # noqa: E501 + + :return: The count of this CoreV1Event. # noqa: E501 + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """Sets the count of this CoreV1Event. + + The number of times this event has occurred. # noqa: E501 + + :param count: The count of this CoreV1Event. # noqa: E501 + :type count: int + """ + + self._count = count + + @property + def event_time(self): + """Gets the event_time of this CoreV1Event. # noqa: E501 + + Time when this Event was first observed. # noqa: E501 + + :return: The event_time of this CoreV1Event. # noqa: E501 + :rtype: datetime + """ + return self._event_time + + @event_time.setter + def event_time(self, event_time): + """Sets the event_time of this CoreV1Event. + + Time when this Event was first observed. # noqa: E501 + + :param event_time: The event_time of this CoreV1Event. # noqa: E501 + :type event_time: datetime + """ + + self._event_time = event_time + + @property + def first_timestamp(self): + """Gets the first_timestamp of this CoreV1Event. # noqa: E501 + + The time at which the event was first recorded. (Time of server receipt is in TypeMeta.) # noqa: E501 + + :return: The first_timestamp of this CoreV1Event. # noqa: E501 + :rtype: datetime + """ + return self._first_timestamp + + @first_timestamp.setter + def first_timestamp(self, first_timestamp): + """Sets the first_timestamp of this CoreV1Event. + + The time at which the event was first recorded. (Time of server receipt is in TypeMeta.) # noqa: E501 + + :param first_timestamp: The first_timestamp of this CoreV1Event. # noqa: E501 + :type first_timestamp: datetime + """ + + self._first_timestamp = first_timestamp + + @property + def involved_object(self): + """Gets the involved_object of this CoreV1Event. # noqa: E501 + + + :return: The involved_object of this CoreV1Event. # noqa: E501 + :rtype: V1ObjectReference + """ + return self._involved_object + + @involved_object.setter + def involved_object(self, involved_object): + """Sets the involved_object of this CoreV1Event. + + + :param involved_object: The involved_object of this CoreV1Event. # noqa: E501 + :type involved_object: V1ObjectReference + """ + if self.local_vars_configuration.client_side_validation and involved_object is None: # noqa: E501 + raise ValueError("Invalid value for `involved_object`, must not be `None`") # noqa: E501 + + self._involved_object = involved_object + + @property + def kind(self): + """Gets the kind of this CoreV1Event. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this CoreV1Event. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this CoreV1Event. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this CoreV1Event. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def last_timestamp(self): + """Gets the last_timestamp of this CoreV1Event. # noqa: E501 + + The time at which the most recent occurrence of this event was recorded. # noqa: E501 + + :return: The last_timestamp of this CoreV1Event. # noqa: E501 + :rtype: datetime + """ + return self._last_timestamp + + @last_timestamp.setter + def last_timestamp(self, last_timestamp): + """Sets the last_timestamp of this CoreV1Event. + + The time at which the most recent occurrence of this event was recorded. # noqa: E501 + + :param last_timestamp: The last_timestamp of this CoreV1Event. # noqa: E501 + :type last_timestamp: datetime + """ + + self._last_timestamp = last_timestamp + + @property + def message(self): + """Gets the message of this CoreV1Event. # noqa: E501 + + A human-readable description of the status of this operation. # noqa: E501 + + :return: The message of this CoreV1Event. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this CoreV1Event. + + A human-readable description of the status of this operation. # noqa: E501 + + :param message: The message of this CoreV1Event. # noqa: E501 + :type message: str + """ + + self._message = message + + @property + def metadata(self): + """Gets the metadata of this CoreV1Event. # noqa: E501 + + + :return: The metadata of this CoreV1Event. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this CoreV1Event. + + + :param metadata: The metadata of this CoreV1Event. # noqa: E501 + :type metadata: V1ObjectMeta + """ + if self.local_vars_configuration.client_side_validation and metadata is None: # noqa: E501 + raise ValueError("Invalid value for `metadata`, must not be `None`") # noqa: E501 + + self._metadata = metadata + + @property + def reason(self): + """Gets the reason of this CoreV1Event. # noqa: E501 + + This should be a short, machine understandable string that gives the reason for the transition into the object's current status. # noqa: E501 + + :return: The reason of this CoreV1Event. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this CoreV1Event. + + This should be a short, machine understandable string that gives the reason for the transition into the object's current status. # noqa: E501 + + :param reason: The reason of this CoreV1Event. # noqa: E501 + :type reason: str + """ + + self._reason = reason + + @property + def related(self): + """Gets the related of this CoreV1Event. # noqa: E501 + + + :return: The related of this CoreV1Event. # noqa: E501 + :rtype: V1ObjectReference + """ + return self._related + + @related.setter + def related(self, related): + """Sets the related of this CoreV1Event. + + + :param related: The related of this CoreV1Event. # noqa: E501 + :type related: V1ObjectReference + """ + + self._related = related + + @property + def reporting_component(self): + """Gets the reporting_component of this CoreV1Event. # noqa: E501 + + Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. # noqa: E501 + + :return: The reporting_component of this CoreV1Event. # noqa: E501 + :rtype: str + """ + return self._reporting_component + + @reporting_component.setter + def reporting_component(self, reporting_component): + """Sets the reporting_component of this CoreV1Event. + + Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. # noqa: E501 + + :param reporting_component: The reporting_component of this CoreV1Event. # noqa: E501 + :type reporting_component: str + """ + + self._reporting_component = reporting_component + + @property + def reporting_instance(self): + """Gets the reporting_instance of this CoreV1Event. # noqa: E501 + + ID of the controller instance, e.g. `kubelet-xyzf`. # noqa: E501 + + :return: The reporting_instance of this CoreV1Event. # noqa: E501 + :rtype: str + """ + return self._reporting_instance + + @reporting_instance.setter + def reporting_instance(self, reporting_instance): + """Sets the reporting_instance of this CoreV1Event. + + ID of the controller instance, e.g. `kubelet-xyzf`. # noqa: E501 + + :param reporting_instance: The reporting_instance of this CoreV1Event. # noqa: E501 + :type reporting_instance: str + """ + + self._reporting_instance = reporting_instance + + @property + def series(self): + """Gets the series of this CoreV1Event. # noqa: E501 + + + :return: The series of this CoreV1Event. # noqa: E501 + :rtype: CoreV1EventSeries + """ + return self._series + + @series.setter + def series(self, series): + """Sets the series of this CoreV1Event. + + + :param series: The series of this CoreV1Event. # noqa: E501 + :type series: CoreV1EventSeries + """ + + self._series = series + + @property + def source(self): + """Gets the source of this CoreV1Event. # noqa: E501 + + + :return: The source of this CoreV1Event. # noqa: E501 + :rtype: V1EventSource + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this CoreV1Event. + + + :param source: The source of this CoreV1Event. # noqa: E501 + :type source: V1EventSource + """ + + self._source = source + + @property + def type(self): + """Gets the type of this CoreV1Event. # noqa: E501 + + Type of this event (Normal, Warning), new types could be added in the future # noqa: E501 + + :return: The type of this CoreV1Event. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this CoreV1Event. + + Type of this event (Normal, Warning), new types could be added in the future # noqa: E501 + + :param type: The type of this CoreV1Event. # noqa: E501 + :type type: str + """ + + self._type = type + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CoreV1Event): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CoreV1Event): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/core_v1_event_list.py b/kubernetes_asyncio/client/models/core_v1_event_list.py new file mode 100644 index 0000000000..25a7ef4624 --- /dev/null +++ b/kubernetes_asyncio/client/models/core_v1_event_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class CoreV1EventList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[CoreV1Event]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """CoreV1EventList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this CoreV1EventList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this CoreV1EventList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this CoreV1EventList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this CoreV1EventList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this CoreV1EventList. # noqa: E501 + + List of events # noqa: E501 + + :return: The items of this CoreV1EventList. # noqa: E501 + :rtype: list[CoreV1Event] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this CoreV1EventList. + + List of events # noqa: E501 + + :param items: The items of this CoreV1EventList. # noqa: E501 + :type items: list[CoreV1Event] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this CoreV1EventList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this CoreV1EventList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this CoreV1EventList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this CoreV1EventList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this CoreV1EventList. # noqa: E501 + + + :return: The metadata of this CoreV1EventList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this CoreV1EventList. + + + :param metadata: The metadata of this CoreV1EventList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CoreV1EventList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CoreV1EventList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/core_v1_event_series.py b/kubernetes_asyncio/client/models/core_v1_event_series.py new file mode 100644 index 0000000000..f0657fbaa5 --- /dev/null +++ b/kubernetes_asyncio/client/models/core_v1_event_series.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class CoreV1EventSeries(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'count': 'int', + 'last_observed_time': 'datetime' + } + + attribute_map = { + 'count': 'count', + 'last_observed_time': 'lastObservedTime' + } + + def __init__(self, count=None, last_observed_time=None, local_vars_configuration=None): # noqa: E501 + """CoreV1EventSeries - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._count = None + self._last_observed_time = None + self.discriminator = None + + if count is not None: + self.count = count + if last_observed_time is not None: + self.last_observed_time = last_observed_time + + @property + def count(self): + """Gets the count of this CoreV1EventSeries. # noqa: E501 + + Number of occurrences in this series up to the last heartbeat time # noqa: E501 + + :return: The count of this CoreV1EventSeries. # noqa: E501 + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """Sets the count of this CoreV1EventSeries. + + Number of occurrences in this series up to the last heartbeat time # noqa: E501 + + :param count: The count of this CoreV1EventSeries. # noqa: E501 + :type count: int + """ + + self._count = count + + @property + def last_observed_time(self): + """Gets the last_observed_time of this CoreV1EventSeries. # noqa: E501 + + Time of the last occurrence observed # noqa: E501 + + :return: The last_observed_time of this CoreV1EventSeries. # noqa: E501 + :rtype: datetime + """ + return self._last_observed_time + + @last_observed_time.setter + def last_observed_time(self, last_observed_time): + """Sets the last_observed_time of this CoreV1EventSeries. + + Time of the last occurrence observed # noqa: E501 + + :param last_observed_time: The last_observed_time of this CoreV1EventSeries. # noqa: E501 + :type last_observed_time: datetime + """ + + self._last_observed_time = last_observed_time + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CoreV1EventSeries): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CoreV1EventSeries): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/core_v1_resource_claim.py b/kubernetes_asyncio/client/models/core_v1_resource_claim.py new file mode 100644 index 0000000000..6b18a8a621 --- /dev/null +++ b/kubernetes_asyncio/client/models/core_v1_resource_claim.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class CoreV1ResourceClaim(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str', + 'request': 'str' + } + + attribute_map = { + 'name': 'name', + 'request': 'request' + } + + def __init__(self, name=None, request=None, local_vars_configuration=None): # noqa: E501 + """CoreV1ResourceClaim - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._name = None + self._request = None + self.discriminator = None + + self.name = name + if request is not None: + self.request = request + + @property + def name(self): + """Gets the name of this CoreV1ResourceClaim. # noqa: E501 + + Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. # noqa: E501 + + :return: The name of this CoreV1ResourceClaim. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CoreV1ResourceClaim. + + Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. # noqa: E501 + + :param name: The name of this CoreV1ResourceClaim. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def request(self): + """Gets the request of this CoreV1ResourceClaim. # noqa: E501 + + Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request. # noqa: E501 + + :return: The request of this CoreV1ResourceClaim. # noqa: E501 + :rtype: str + """ + return self._request + + @request.setter + def request(self, request): + """Sets the request of this CoreV1ResourceClaim. + + Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request. # noqa: E501 + + :param request: The request of this CoreV1ResourceClaim. # noqa: E501 + :type request: str + """ + + self._request = request + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CoreV1ResourceClaim): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, CoreV1ResourceClaim): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/discovery_v1_endpoint_port.py b/kubernetes_asyncio/client/models/discovery_v1_endpoint_port.py new file mode 100644 index 0000000000..b17812a8a9 --- /dev/null +++ b/kubernetes_asyncio/client/models/discovery_v1_endpoint_port.py @@ -0,0 +1,217 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class DiscoveryV1EndpointPort(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'app_protocol': 'str', + 'name': 'str', + 'port': 'int', + 'protocol': 'str' + } + + attribute_map = { + 'app_protocol': 'appProtocol', + 'name': 'name', + 'port': 'port', + 'protocol': 'protocol' + } + + def __init__(self, app_protocol=None, name=None, port=None, protocol=None, local_vars_configuration=None): # noqa: E501 + """DiscoveryV1EndpointPort - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._app_protocol = None + self._name = None + self._port = None + self._protocol = None + self.discriminator = None + + if app_protocol is not None: + self.app_protocol = app_protocol + if name is not None: + self.name = name + if port is not None: + self.port = port + if protocol is not None: + self.protocol = protocol + + @property + def app_protocol(self): + """Gets the app_protocol of this DiscoveryV1EndpointPort. # noqa: E501 + + The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either: * Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 * Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol. # noqa: E501 + + :return: The app_protocol of this DiscoveryV1EndpointPort. # noqa: E501 + :rtype: str + """ + return self._app_protocol + + @app_protocol.setter + def app_protocol(self, app_protocol): + """Sets the app_protocol of this DiscoveryV1EndpointPort. + + The application protocol for this port. This is used as a hint for implementations to offer richer behavior for protocols that they understand. This field follows standard Kubernetes label syntax. Valid values are either: * Un-prefixed protocol names - reserved for IANA standard service names (as per RFC-6335 and https://www.iana.org/assignments/service-names). * Kubernetes-defined prefixed names: * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior- * 'kubernetes.io/ws' - WebSocket over cleartext as described in https://www.rfc-editor.org/rfc/rfc6455 * 'kubernetes.io/wss' - WebSocket over TLS as described in https://www.rfc-editor.org/rfc/rfc6455 * Other protocols should use implementation-defined prefixed names such as mycompany.com/my-custom-protocol. # noqa: E501 + + :param app_protocol: The app_protocol of this DiscoveryV1EndpointPort. # noqa: E501 + :type app_protocol: str + """ + + self._app_protocol = app_protocol + + @property + def name(self): + """Gets the name of this DiscoveryV1EndpointPort. # noqa: E501 + + name represents the name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string. # noqa: E501 + + :return: The name of this DiscoveryV1EndpointPort. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DiscoveryV1EndpointPort. + + name represents the name of this port. All ports in an EndpointSlice must have a unique name. If the EndpointSlice is derived from a Kubernetes service, this corresponds to the Service.ports[].name. Name must either be an empty string or pass DNS_LABEL validation: * must be no more than 63 characters long. * must consist of lower case alphanumeric characters or '-'. * must start and end with an alphanumeric character. Default is empty string. # noqa: E501 + + :param name: The name of this DiscoveryV1EndpointPort. # noqa: E501 + :type name: str + """ + + self._name = name + + @property + def port(self): + """Gets the port of this DiscoveryV1EndpointPort. # noqa: E501 + + port represents the port number of the endpoint. If the EndpointSlice is derived from a Kubernetes service, this must be set to the service's target port. EndpointSlices used for other purposes may have a nil port. # noqa: E501 + + :return: The port of this DiscoveryV1EndpointPort. # noqa: E501 + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """Sets the port of this DiscoveryV1EndpointPort. + + port represents the port number of the endpoint. If the EndpointSlice is derived from a Kubernetes service, this must be set to the service's target port. EndpointSlices used for other purposes may have a nil port. # noqa: E501 + + :param port: The port of this DiscoveryV1EndpointPort. # noqa: E501 + :type port: int + """ + + self._port = port + + @property + def protocol(self): + """Gets the protocol of this DiscoveryV1EndpointPort. # noqa: E501 + + protocol represents the IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP. # noqa: E501 + + :return: The protocol of this DiscoveryV1EndpointPort. # noqa: E501 + :rtype: str + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol): + """Sets the protocol of this DiscoveryV1EndpointPort. + + protocol represents the IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP. # noqa: E501 + + :param protocol: The protocol of this DiscoveryV1EndpointPort. # noqa: E501 + :type protocol: str + """ + + self._protocol = protocol + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DiscoveryV1EndpointPort): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DiscoveryV1EndpointPort): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/events_v1_event.py b/kubernetes_asyncio/client/models/events_v1_event.py new file mode 100644 index 0000000000..51b263ae14 --- /dev/null +++ b/kubernetes_asyncio/client/models/events_v1_event.py @@ -0,0 +1,572 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class EventsV1Event(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'action': 'str', + 'api_version': 'str', + 'deprecated_count': 'int', + 'deprecated_first_timestamp': 'datetime', + 'deprecated_last_timestamp': 'datetime', + 'deprecated_source': 'V1EventSource', + 'event_time': 'datetime', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'note': 'str', + 'reason': 'str', + 'regarding': 'V1ObjectReference', + 'related': 'V1ObjectReference', + 'reporting_controller': 'str', + 'reporting_instance': 'str', + 'series': 'EventsV1EventSeries', + 'type': 'str' + } + + attribute_map = { + 'action': 'action', + 'api_version': 'apiVersion', + 'deprecated_count': 'deprecatedCount', + 'deprecated_first_timestamp': 'deprecatedFirstTimestamp', + 'deprecated_last_timestamp': 'deprecatedLastTimestamp', + 'deprecated_source': 'deprecatedSource', + 'event_time': 'eventTime', + 'kind': 'kind', + 'metadata': 'metadata', + 'note': 'note', + 'reason': 'reason', + 'regarding': 'regarding', + 'related': 'related', + 'reporting_controller': 'reportingController', + 'reporting_instance': 'reportingInstance', + 'series': 'series', + 'type': 'type' + } + + def __init__(self, action=None, api_version=None, deprecated_count=None, deprecated_first_timestamp=None, deprecated_last_timestamp=None, deprecated_source=None, event_time=None, kind=None, metadata=None, note=None, reason=None, regarding=None, related=None, reporting_controller=None, reporting_instance=None, series=None, type=None, local_vars_configuration=None): # noqa: E501 + """EventsV1Event - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._action = None + self._api_version = None + self._deprecated_count = None + self._deprecated_first_timestamp = None + self._deprecated_last_timestamp = None + self._deprecated_source = None + self._event_time = None + self._kind = None + self._metadata = None + self._note = None + self._reason = None + self._regarding = None + self._related = None + self._reporting_controller = None + self._reporting_instance = None + self._series = None + self._type = None + self.discriminator = None + + if action is not None: + self.action = action + if api_version is not None: + self.api_version = api_version + if deprecated_count is not None: + self.deprecated_count = deprecated_count + if deprecated_first_timestamp is not None: + self.deprecated_first_timestamp = deprecated_first_timestamp + if deprecated_last_timestamp is not None: + self.deprecated_last_timestamp = deprecated_last_timestamp + if deprecated_source is not None: + self.deprecated_source = deprecated_source + self.event_time = event_time + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + if note is not None: + self.note = note + if reason is not None: + self.reason = reason + if regarding is not None: + self.regarding = regarding + if related is not None: + self.related = related + if reporting_controller is not None: + self.reporting_controller = reporting_controller + if reporting_instance is not None: + self.reporting_instance = reporting_instance + if series is not None: + self.series = series + if type is not None: + self.type = type + + @property + def action(self): + """Gets the action of this EventsV1Event. # noqa: E501 + + action is what action was taken/failed regarding to the regarding object. It is machine-readable. This field cannot be empty for new Events and it can have at most 128 characters. # noqa: E501 + + :return: The action of this EventsV1Event. # noqa: E501 + :rtype: str + """ + return self._action + + @action.setter + def action(self, action): + """Sets the action of this EventsV1Event. + + action is what action was taken/failed regarding to the regarding object. It is machine-readable. This field cannot be empty for new Events and it can have at most 128 characters. # noqa: E501 + + :param action: The action of this EventsV1Event. # noqa: E501 + :type action: str + """ + + self._action = action + + @property + def api_version(self): + """Gets the api_version of this EventsV1Event. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this EventsV1Event. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this EventsV1Event. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this EventsV1Event. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def deprecated_count(self): + """Gets the deprecated_count of this EventsV1Event. # noqa: E501 + + deprecatedCount is the deprecated field assuring backward compatibility with core.v1 Event type. # noqa: E501 + + :return: The deprecated_count of this EventsV1Event. # noqa: E501 + :rtype: int + """ + return self._deprecated_count + + @deprecated_count.setter + def deprecated_count(self, deprecated_count): + """Sets the deprecated_count of this EventsV1Event. + + deprecatedCount is the deprecated field assuring backward compatibility with core.v1 Event type. # noqa: E501 + + :param deprecated_count: The deprecated_count of this EventsV1Event. # noqa: E501 + :type deprecated_count: int + """ + + self._deprecated_count = deprecated_count + + @property + def deprecated_first_timestamp(self): + """Gets the deprecated_first_timestamp of this EventsV1Event. # noqa: E501 + + deprecatedFirstTimestamp is the deprecated field assuring backward compatibility with core.v1 Event type. # noqa: E501 + + :return: The deprecated_first_timestamp of this EventsV1Event. # noqa: E501 + :rtype: datetime + """ + return self._deprecated_first_timestamp + + @deprecated_first_timestamp.setter + def deprecated_first_timestamp(self, deprecated_first_timestamp): + """Sets the deprecated_first_timestamp of this EventsV1Event. + + deprecatedFirstTimestamp is the deprecated field assuring backward compatibility with core.v1 Event type. # noqa: E501 + + :param deprecated_first_timestamp: The deprecated_first_timestamp of this EventsV1Event. # noqa: E501 + :type deprecated_first_timestamp: datetime + """ + + self._deprecated_first_timestamp = deprecated_first_timestamp + + @property + def deprecated_last_timestamp(self): + """Gets the deprecated_last_timestamp of this EventsV1Event. # noqa: E501 + + deprecatedLastTimestamp is the deprecated field assuring backward compatibility with core.v1 Event type. # noqa: E501 + + :return: The deprecated_last_timestamp of this EventsV1Event. # noqa: E501 + :rtype: datetime + """ + return self._deprecated_last_timestamp + + @deprecated_last_timestamp.setter + def deprecated_last_timestamp(self, deprecated_last_timestamp): + """Sets the deprecated_last_timestamp of this EventsV1Event. + + deprecatedLastTimestamp is the deprecated field assuring backward compatibility with core.v1 Event type. # noqa: E501 + + :param deprecated_last_timestamp: The deprecated_last_timestamp of this EventsV1Event. # noqa: E501 + :type deprecated_last_timestamp: datetime + """ + + self._deprecated_last_timestamp = deprecated_last_timestamp + + @property + def deprecated_source(self): + """Gets the deprecated_source of this EventsV1Event. # noqa: E501 + + + :return: The deprecated_source of this EventsV1Event. # noqa: E501 + :rtype: V1EventSource + """ + return self._deprecated_source + + @deprecated_source.setter + def deprecated_source(self, deprecated_source): + """Sets the deprecated_source of this EventsV1Event. + + + :param deprecated_source: The deprecated_source of this EventsV1Event. # noqa: E501 + :type deprecated_source: V1EventSource + """ + + self._deprecated_source = deprecated_source + + @property + def event_time(self): + """Gets the event_time of this EventsV1Event. # noqa: E501 + + eventTime is the time when this Event was first observed. It is required. # noqa: E501 + + :return: The event_time of this EventsV1Event. # noqa: E501 + :rtype: datetime + """ + return self._event_time + + @event_time.setter + def event_time(self, event_time): + """Sets the event_time of this EventsV1Event. + + eventTime is the time when this Event was first observed. It is required. # noqa: E501 + + :param event_time: The event_time of this EventsV1Event. # noqa: E501 + :type event_time: datetime + """ + if self.local_vars_configuration.client_side_validation and event_time is None: # noqa: E501 + raise ValueError("Invalid value for `event_time`, must not be `None`") # noqa: E501 + + self._event_time = event_time + + @property + def kind(self): + """Gets the kind of this EventsV1Event. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this EventsV1Event. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this EventsV1Event. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this EventsV1Event. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this EventsV1Event. # noqa: E501 + + + :return: The metadata of this EventsV1Event. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this EventsV1Event. + + + :param metadata: The metadata of this EventsV1Event. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def note(self): + """Gets the note of this EventsV1Event. # noqa: E501 + + note is a human-readable description of the status of this operation. Maximal length of the note is 1kB, but libraries should be prepared to handle values up to 64kB. # noqa: E501 + + :return: The note of this EventsV1Event. # noqa: E501 + :rtype: str + """ + return self._note + + @note.setter + def note(self, note): + """Sets the note of this EventsV1Event. + + note is a human-readable description of the status of this operation. Maximal length of the note is 1kB, but libraries should be prepared to handle values up to 64kB. # noqa: E501 + + :param note: The note of this EventsV1Event. # noqa: E501 + :type note: str + """ + + self._note = note + + @property + def reason(self): + """Gets the reason of this EventsV1Event. # noqa: E501 + + reason is why the action was taken. It is human-readable. This field cannot be empty for new Events and it can have at most 128 characters. # noqa: E501 + + :return: The reason of this EventsV1Event. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this EventsV1Event. + + reason is why the action was taken. It is human-readable. This field cannot be empty for new Events and it can have at most 128 characters. # noqa: E501 + + :param reason: The reason of this EventsV1Event. # noqa: E501 + :type reason: str + """ + + self._reason = reason + + @property + def regarding(self): + """Gets the regarding of this EventsV1Event. # noqa: E501 + + + :return: The regarding of this EventsV1Event. # noqa: E501 + :rtype: V1ObjectReference + """ + return self._regarding + + @regarding.setter + def regarding(self, regarding): + """Sets the regarding of this EventsV1Event. + + + :param regarding: The regarding of this EventsV1Event. # noqa: E501 + :type regarding: V1ObjectReference + """ + + self._regarding = regarding + + @property + def related(self): + """Gets the related of this EventsV1Event. # noqa: E501 + + + :return: The related of this EventsV1Event. # noqa: E501 + :rtype: V1ObjectReference + """ + return self._related + + @related.setter + def related(self, related): + """Sets the related of this EventsV1Event. + + + :param related: The related of this EventsV1Event. # noqa: E501 + :type related: V1ObjectReference + """ + + self._related = related + + @property + def reporting_controller(self): + """Gets the reporting_controller of this EventsV1Event. # noqa: E501 + + reportingController is the name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. This field cannot be empty for new Events. # noqa: E501 + + :return: The reporting_controller of this EventsV1Event. # noqa: E501 + :rtype: str + """ + return self._reporting_controller + + @reporting_controller.setter + def reporting_controller(self, reporting_controller): + """Sets the reporting_controller of this EventsV1Event. + + reportingController is the name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. This field cannot be empty for new Events. # noqa: E501 + + :param reporting_controller: The reporting_controller of this EventsV1Event. # noqa: E501 + :type reporting_controller: str + """ + + self._reporting_controller = reporting_controller + + @property + def reporting_instance(self): + """Gets the reporting_instance of this EventsV1Event. # noqa: E501 + + reportingInstance is the ID of the controller instance, e.g. `kubelet-xyzf`. This field cannot be empty for new Events and it can have at most 128 characters. # noqa: E501 + + :return: The reporting_instance of this EventsV1Event. # noqa: E501 + :rtype: str + """ + return self._reporting_instance + + @reporting_instance.setter + def reporting_instance(self, reporting_instance): + """Sets the reporting_instance of this EventsV1Event. + + reportingInstance is the ID of the controller instance, e.g. `kubelet-xyzf`. This field cannot be empty for new Events and it can have at most 128 characters. # noqa: E501 + + :param reporting_instance: The reporting_instance of this EventsV1Event. # noqa: E501 + :type reporting_instance: str + """ + + self._reporting_instance = reporting_instance + + @property + def series(self): + """Gets the series of this EventsV1Event. # noqa: E501 + + + :return: The series of this EventsV1Event. # noqa: E501 + :rtype: EventsV1EventSeries + """ + return self._series + + @series.setter + def series(self, series): + """Sets the series of this EventsV1Event. + + + :param series: The series of this EventsV1Event. # noqa: E501 + :type series: EventsV1EventSeries + """ + + self._series = series + + @property + def type(self): + """Gets the type of this EventsV1Event. # noqa: E501 + + type is the type of this event (Normal, Warning), new types could be added in the future. It is machine-readable. This field cannot be empty for new Events. # noqa: E501 + + :return: The type of this EventsV1Event. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this EventsV1Event. + + type is the type of this event (Normal, Warning), new types could be added in the future. It is machine-readable. This field cannot be empty for new Events. # noqa: E501 + + :param type: The type of this EventsV1Event. # noqa: E501 + :type type: str + """ + + self._type = type + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EventsV1Event): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, EventsV1Event): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/events_v1_event_list.py b/kubernetes_asyncio/client/models/events_v1_event_list.py new file mode 100644 index 0000000000..671c5c9b2d --- /dev/null +++ b/kubernetes_asyncio/client/models/events_v1_event_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class EventsV1EventList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[EventsV1Event]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """EventsV1EventList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this EventsV1EventList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this EventsV1EventList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this EventsV1EventList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this EventsV1EventList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this EventsV1EventList. # noqa: E501 + + items is a list of schema objects. # noqa: E501 + + :return: The items of this EventsV1EventList. # noqa: E501 + :rtype: list[EventsV1Event] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this EventsV1EventList. + + items is a list of schema objects. # noqa: E501 + + :param items: The items of this EventsV1EventList. # noqa: E501 + :type items: list[EventsV1Event] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this EventsV1EventList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this EventsV1EventList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this EventsV1EventList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this EventsV1EventList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this EventsV1EventList. # noqa: E501 + + + :return: The metadata of this EventsV1EventList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this EventsV1EventList. + + + :param metadata: The metadata of this EventsV1EventList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EventsV1EventList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, EventsV1EventList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/events_v1_event_series.py b/kubernetes_asyncio/client/models/events_v1_event_series.py new file mode 100644 index 0000000000..d4e97abed9 --- /dev/null +++ b/kubernetes_asyncio/client/models/events_v1_event_series.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class EventsV1EventSeries(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'count': 'int', + 'last_observed_time': 'datetime' + } + + attribute_map = { + 'count': 'count', + 'last_observed_time': 'lastObservedTime' + } + + def __init__(self, count=None, last_observed_time=None, local_vars_configuration=None): # noqa: E501 + """EventsV1EventSeries - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._count = None + self._last_observed_time = None + self.discriminator = None + + self.count = count + self.last_observed_time = last_observed_time + + @property + def count(self): + """Gets the count of this EventsV1EventSeries. # noqa: E501 + + count is the number of occurrences in this series up to the last heartbeat time. # noqa: E501 + + :return: The count of this EventsV1EventSeries. # noqa: E501 + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """Sets the count of this EventsV1EventSeries. + + count is the number of occurrences in this series up to the last heartbeat time. # noqa: E501 + + :param count: The count of this EventsV1EventSeries. # noqa: E501 + :type count: int + """ + if self.local_vars_configuration.client_side_validation and count is None: # noqa: E501 + raise ValueError("Invalid value for `count`, must not be `None`") # noqa: E501 + + self._count = count + + @property + def last_observed_time(self): + """Gets the last_observed_time of this EventsV1EventSeries. # noqa: E501 + + lastObservedTime is the time when last Event from the series was seen before last heartbeat. # noqa: E501 + + :return: The last_observed_time of this EventsV1EventSeries. # noqa: E501 + :rtype: datetime + """ + return self._last_observed_time + + @last_observed_time.setter + def last_observed_time(self, last_observed_time): + """Sets the last_observed_time of this EventsV1EventSeries. + + lastObservedTime is the time when last Event from the series was seen before last heartbeat. # noqa: E501 + + :param last_observed_time: The last_observed_time of this EventsV1EventSeries. # noqa: E501 + :type last_observed_time: datetime + """ + if self.local_vars_configuration.client_side_validation and last_observed_time is None: # noqa: E501 + raise ValueError("Invalid value for `last_observed_time`, must not be `None`") # noqa: E501 + + self._last_observed_time = last_observed_time + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EventsV1EventSeries): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, EventsV1EventSeries): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/flowcontrol_v1_subject.py b/kubernetes_asyncio/client/models/flowcontrol_v1_subject.py new file mode 100644 index 0000000000..7f59fee292 --- /dev/null +++ b/kubernetes_asyncio/client/models/flowcontrol_v1_subject.py @@ -0,0 +1,212 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class FlowcontrolV1Subject(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'group': 'V1GroupSubject', + 'kind': 'str', + 'service_account': 'V1ServiceAccountSubject', + 'user': 'V1UserSubject' + } + + attribute_map = { + 'group': 'group', + 'kind': 'kind', + 'service_account': 'serviceAccount', + 'user': 'user' + } + + def __init__(self, group=None, kind=None, service_account=None, user=None, local_vars_configuration=None): # noqa: E501 + """FlowcontrolV1Subject - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._group = None + self._kind = None + self._service_account = None + self._user = None + self.discriminator = None + + if group is not None: + self.group = group + self.kind = kind + if service_account is not None: + self.service_account = service_account + if user is not None: + self.user = user + + @property + def group(self): + """Gets the group of this FlowcontrolV1Subject. # noqa: E501 + + + :return: The group of this FlowcontrolV1Subject. # noqa: E501 + :rtype: V1GroupSubject + """ + return self._group + + @group.setter + def group(self, group): + """Sets the group of this FlowcontrolV1Subject. + + + :param group: The group of this FlowcontrolV1Subject. # noqa: E501 + :type group: V1GroupSubject + """ + + self._group = group + + @property + def kind(self): + """Gets the kind of this FlowcontrolV1Subject. # noqa: E501 + + `kind` indicates which one of the other fields is non-empty. Required # noqa: E501 + + :return: The kind of this FlowcontrolV1Subject. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this FlowcontrolV1Subject. + + `kind` indicates which one of the other fields is non-empty. Required # noqa: E501 + + :param kind: The kind of this FlowcontrolV1Subject. # noqa: E501 + :type kind: str + """ + if self.local_vars_configuration.client_side_validation and kind is None: # noqa: E501 + raise ValueError("Invalid value for `kind`, must not be `None`") # noqa: E501 + + self._kind = kind + + @property + def service_account(self): + """Gets the service_account of this FlowcontrolV1Subject. # noqa: E501 + + + :return: The service_account of this FlowcontrolV1Subject. # noqa: E501 + :rtype: V1ServiceAccountSubject + """ + return self._service_account + + @service_account.setter + def service_account(self, service_account): + """Sets the service_account of this FlowcontrolV1Subject. + + + :param service_account: The service_account of this FlowcontrolV1Subject. # noqa: E501 + :type service_account: V1ServiceAccountSubject + """ + + self._service_account = service_account + + @property + def user(self): + """Gets the user of this FlowcontrolV1Subject. # noqa: E501 + + + :return: The user of this FlowcontrolV1Subject. # noqa: E501 + :rtype: V1UserSubject + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this FlowcontrolV1Subject. + + + :param user: The user of this FlowcontrolV1Subject. # noqa: E501 + :type user: V1UserSubject + """ + + self._user = user + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, FlowcontrolV1Subject): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, FlowcontrolV1Subject): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/rbac_v1_subject.py b/kubernetes_asyncio/client/models/rbac_v1_subject.py new file mode 100644 index 0000000000..083987ed49 --- /dev/null +++ b/kubernetes_asyncio/client/models/rbac_v1_subject.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class RbacV1Subject(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_group': 'str', + 'kind': 'str', + 'name': 'str', + 'namespace': 'str' + } + + attribute_map = { + 'api_group': 'apiGroup', + 'kind': 'kind', + 'name': 'name', + 'namespace': 'namespace' + } + + def __init__(self, api_group=None, kind=None, name=None, namespace=None, local_vars_configuration=None): # noqa: E501 + """RbacV1Subject - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_group = None + self._kind = None + self._name = None + self._namespace = None + self.discriminator = None + + if api_group is not None: + self.api_group = api_group + self.kind = kind + self.name = name + if namespace is not None: + self.namespace = namespace + + @property + def api_group(self): + """Gets the api_group of this RbacV1Subject. # noqa: E501 + + APIGroup holds the API group of the referenced subject. Defaults to \"\" for ServiceAccount subjects. Defaults to \"rbac.authorization.k8s.io\" for User and Group subjects. # noqa: E501 + + :return: The api_group of this RbacV1Subject. # noqa: E501 + :rtype: str + """ + return self._api_group + + @api_group.setter + def api_group(self, api_group): + """Sets the api_group of this RbacV1Subject. + + APIGroup holds the API group of the referenced subject. Defaults to \"\" for ServiceAccount subjects. Defaults to \"rbac.authorization.k8s.io\" for User and Group subjects. # noqa: E501 + + :param api_group: The api_group of this RbacV1Subject. # noqa: E501 + :type api_group: str + """ + + self._api_group = api_group + + @property + def kind(self): + """Gets the kind of this RbacV1Subject. # noqa: E501 + + Kind of object being referenced. Values defined by this API group are \"User\", \"Group\", and \"ServiceAccount\". If the Authorizer does not recognized the kind value, the Authorizer should report an error. # noqa: E501 + + :return: The kind of this RbacV1Subject. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this RbacV1Subject. + + Kind of object being referenced. Values defined by this API group are \"User\", \"Group\", and \"ServiceAccount\". If the Authorizer does not recognized the kind value, the Authorizer should report an error. # noqa: E501 + + :param kind: The kind of this RbacV1Subject. # noqa: E501 + :type kind: str + """ + if self.local_vars_configuration.client_side_validation and kind is None: # noqa: E501 + raise ValueError("Invalid value for `kind`, must not be `None`") # noqa: E501 + + self._kind = kind + + @property + def name(self): + """Gets the name of this RbacV1Subject. # noqa: E501 + + Name of the object being referenced. # noqa: E501 + + :return: The name of this RbacV1Subject. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this RbacV1Subject. + + Name of the object being referenced. # noqa: E501 + + :param name: The name of this RbacV1Subject. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def namespace(self): + """Gets the namespace of this RbacV1Subject. # noqa: E501 + + Namespace of the referenced object. If the object kind is non-namespace, such as \"User\" or \"Group\", and this value is not empty the Authorizer should report an error. # noqa: E501 + + :return: The namespace of this RbacV1Subject. # noqa: E501 + :rtype: str + """ + return self._namespace + + @namespace.setter + def namespace(self, namespace): + """Sets the namespace of this RbacV1Subject. + + Namespace of the referenced object. If the object kind is non-namespace, such as \"User\" or \"Group\", and this value is not empty the Authorizer should report an error. # noqa: E501 + + :param namespace: The namespace of this RbacV1Subject. # noqa: E501 + :type namespace: str + """ + + self._namespace = namespace + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RbacV1Subject): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, RbacV1Subject): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/resource_v1_resource_claim.py b/kubernetes_asyncio/client/models/resource_v1_resource_claim.py new file mode 100644 index 0000000000..7ef5702871 --- /dev/null +++ b/kubernetes_asyncio/client/models/resource_v1_resource_claim.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class ResourceV1ResourceClaim(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'spec': 'V1ResourceClaimSpec', + 'status': 'V1ResourceClaimStatus' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'spec': 'spec', + 'status': 'status' + } + + def __init__(self, api_version=None, kind=None, metadata=None, spec=None, status=None, local_vars_configuration=None): # noqa: E501 + """ResourceV1ResourceClaim - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._metadata = None + self._spec = None + self._status = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + self.spec = spec + if status is not None: + self.status = status + + @property + def api_version(self): + """Gets the api_version of this ResourceV1ResourceClaim. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this ResourceV1ResourceClaim. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this ResourceV1ResourceClaim. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this ResourceV1ResourceClaim. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this ResourceV1ResourceClaim. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this ResourceV1ResourceClaim. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this ResourceV1ResourceClaim. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this ResourceV1ResourceClaim. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this ResourceV1ResourceClaim. # noqa: E501 + + + :return: The metadata of this ResourceV1ResourceClaim. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this ResourceV1ResourceClaim. + + + :param metadata: The metadata of this ResourceV1ResourceClaim. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def spec(self): + """Gets the spec of this ResourceV1ResourceClaim. # noqa: E501 + + + :return: The spec of this ResourceV1ResourceClaim. # noqa: E501 + :rtype: V1ResourceClaimSpec + """ + return self._spec + + @spec.setter + def spec(self, spec): + """Sets the spec of this ResourceV1ResourceClaim. + + + :param spec: The spec of this ResourceV1ResourceClaim. # noqa: E501 + :type spec: V1ResourceClaimSpec + """ + if self.local_vars_configuration.client_side_validation and spec is None: # noqa: E501 + raise ValueError("Invalid value for `spec`, must not be `None`") # noqa: E501 + + self._spec = spec + + @property + def status(self): + """Gets the status of this ResourceV1ResourceClaim. # noqa: E501 + + + :return: The status of this ResourceV1ResourceClaim. # noqa: E501 + :rtype: V1ResourceClaimStatus + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ResourceV1ResourceClaim. + + + :param status: The status of this ResourceV1ResourceClaim. # noqa: E501 + :type status: V1ResourceClaimStatus + """ + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ResourceV1ResourceClaim): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ResourceV1ResourceClaim): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/storage_v1_token_request.py b/kubernetes_asyncio/client/models/storage_v1_token_request.py new file mode 100644 index 0000000000..8aaa966155 --- /dev/null +++ b/kubernetes_asyncio/client/models/storage_v1_token_request.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class StorageV1TokenRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'audience': 'str', + 'expiration_seconds': 'int' + } + + attribute_map = { + 'audience': 'audience', + 'expiration_seconds': 'expirationSeconds' + } + + def __init__(self, audience=None, expiration_seconds=None, local_vars_configuration=None): # noqa: E501 + """StorageV1TokenRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._audience = None + self._expiration_seconds = None + self.discriminator = None + + self.audience = audience + if expiration_seconds is not None: + self.expiration_seconds = expiration_seconds + + @property + def audience(self): + """Gets the audience of this StorageV1TokenRequest. # noqa: E501 + + audience is the intended audience of the token in \"TokenRequestSpec\". It will default to the audiences of kube apiserver. # noqa: E501 + + :return: The audience of this StorageV1TokenRequest. # noqa: E501 + :rtype: str + """ + return self._audience + + @audience.setter + def audience(self, audience): + """Sets the audience of this StorageV1TokenRequest. + + audience is the intended audience of the token in \"TokenRequestSpec\". It will default to the audiences of kube apiserver. # noqa: E501 + + :param audience: The audience of this StorageV1TokenRequest. # noqa: E501 + :type audience: str + """ + if self.local_vars_configuration.client_side_validation and audience is None: # noqa: E501 + raise ValueError("Invalid value for `audience`, must not be `None`") # noqa: E501 + + self._audience = audience + + @property + def expiration_seconds(self): + """Gets the expiration_seconds of this StorageV1TokenRequest. # noqa: E501 + + expirationSeconds is the duration of validity of the token in \"TokenRequestSpec\". It has the same default value of \"ExpirationSeconds\" in \"TokenRequestSpec\". # noqa: E501 + + :return: The expiration_seconds of this StorageV1TokenRequest. # noqa: E501 + :rtype: int + """ + return self._expiration_seconds + + @expiration_seconds.setter + def expiration_seconds(self, expiration_seconds): + """Sets the expiration_seconds of this StorageV1TokenRequest. + + expirationSeconds is the duration of validity of the token in \"TokenRequestSpec\". It has the same default value of \"ExpirationSeconds\" in \"TokenRequestSpec\". # noqa: E501 + + :param expiration_seconds: The expiration_seconds of this StorageV1TokenRequest. # noqa: E501 + :type expiration_seconds: int + """ + + self._expiration_seconds = expiration_seconds + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StorageV1TokenRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StorageV1TokenRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_affinity.py b/kubernetes_asyncio/client/models/v1_affinity.py new file mode 100644 index 0000000000..896060d92e --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_affinity.py @@ -0,0 +1,183 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1Affinity(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'node_affinity': 'V1NodeAffinity', + 'pod_affinity': 'V1PodAffinity', + 'pod_anti_affinity': 'V1PodAntiAffinity' + } + + attribute_map = { + 'node_affinity': 'nodeAffinity', + 'pod_affinity': 'podAffinity', + 'pod_anti_affinity': 'podAntiAffinity' + } + + def __init__(self, node_affinity=None, pod_affinity=None, pod_anti_affinity=None, local_vars_configuration=None): # noqa: E501 + """V1Affinity - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._node_affinity = None + self._pod_affinity = None + self._pod_anti_affinity = None + self.discriminator = None + + if node_affinity is not None: + self.node_affinity = node_affinity + if pod_affinity is not None: + self.pod_affinity = pod_affinity + if pod_anti_affinity is not None: + self.pod_anti_affinity = pod_anti_affinity + + @property + def node_affinity(self): + """Gets the node_affinity of this V1Affinity. # noqa: E501 + + + :return: The node_affinity of this V1Affinity. # noqa: E501 + :rtype: V1NodeAffinity + """ + return self._node_affinity + + @node_affinity.setter + def node_affinity(self, node_affinity): + """Sets the node_affinity of this V1Affinity. + + + :param node_affinity: The node_affinity of this V1Affinity. # noqa: E501 + :type node_affinity: V1NodeAffinity + """ + + self._node_affinity = node_affinity + + @property + def pod_affinity(self): + """Gets the pod_affinity of this V1Affinity. # noqa: E501 + + + :return: The pod_affinity of this V1Affinity. # noqa: E501 + :rtype: V1PodAffinity + """ + return self._pod_affinity + + @pod_affinity.setter + def pod_affinity(self, pod_affinity): + """Sets the pod_affinity of this V1Affinity. + + + :param pod_affinity: The pod_affinity of this V1Affinity. # noqa: E501 + :type pod_affinity: V1PodAffinity + """ + + self._pod_affinity = pod_affinity + + @property + def pod_anti_affinity(self): + """Gets the pod_anti_affinity of this V1Affinity. # noqa: E501 + + + :return: The pod_anti_affinity of this V1Affinity. # noqa: E501 + :rtype: V1PodAntiAffinity + """ + return self._pod_anti_affinity + + @pod_anti_affinity.setter + def pod_anti_affinity(self, pod_anti_affinity): + """Sets the pod_anti_affinity of this V1Affinity. + + + :param pod_anti_affinity: The pod_anti_affinity of this V1Affinity. # noqa: E501 + :type pod_anti_affinity: V1PodAntiAffinity + """ + + self._pod_anti_affinity = pod_anti_affinity + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1Affinity): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1Affinity): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_aggregation_rule.py b/kubernetes_asyncio/client/models/v1_aggregation_rule.py new file mode 100644 index 0000000000..722103cfa3 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_aggregation_rule.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1AggregationRule(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'cluster_role_selectors': 'list[V1LabelSelector]' + } + + attribute_map = { + 'cluster_role_selectors': 'clusterRoleSelectors' + } + + def __init__(self, cluster_role_selectors=None, local_vars_configuration=None): # noqa: E501 + """V1AggregationRule - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._cluster_role_selectors = None + self.discriminator = None + + if cluster_role_selectors is not None: + self.cluster_role_selectors = cluster_role_selectors + + @property + def cluster_role_selectors(self): + """Gets the cluster_role_selectors of this V1AggregationRule. # noqa: E501 + + ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be added # noqa: E501 + + :return: The cluster_role_selectors of this V1AggregationRule. # noqa: E501 + :rtype: list[V1LabelSelector] + """ + return self._cluster_role_selectors + + @cluster_role_selectors.setter + def cluster_role_selectors(self, cluster_role_selectors): + """Sets the cluster_role_selectors of this V1AggregationRule. + + ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be added # noqa: E501 + + :param cluster_role_selectors: The cluster_role_selectors of this V1AggregationRule. # noqa: E501 + :type cluster_role_selectors: list[V1LabelSelector] + """ + + self._cluster_role_selectors = cluster_role_selectors + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1AggregationRule): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1AggregationRule): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_allocated_device_status.py b/kubernetes_asyncio/client/models/v1_allocated_device_status.py new file mode 100644 index 0000000000..508c2c74bf --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_allocated_device_status.py @@ -0,0 +1,302 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1AllocatedDeviceStatus(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'conditions': 'list[V1Condition]', + 'data': 'object', + 'device': 'str', + 'driver': 'str', + 'network_data': 'V1NetworkDeviceData', + 'pool': 'str', + 'share_id': 'str' + } + + attribute_map = { + 'conditions': 'conditions', + 'data': 'data', + 'device': 'device', + 'driver': 'driver', + 'network_data': 'networkData', + 'pool': 'pool', + 'share_id': 'shareID' + } + + def __init__(self, conditions=None, data=None, device=None, driver=None, network_data=None, pool=None, share_id=None, local_vars_configuration=None): # noqa: E501 + """V1AllocatedDeviceStatus - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._conditions = None + self._data = None + self._device = None + self._driver = None + self._network_data = None + self._pool = None + self._share_id = None + self.discriminator = None + + if conditions is not None: + self.conditions = conditions + if data is not None: + self.data = data + self.device = device + self.driver = driver + if network_data is not None: + self.network_data = network_data + self.pool = pool + if share_id is not None: + self.share_id = share_id + + @property + def conditions(self): + """Gets the conditions of this V1AllocatedDeviceStatus. # noqa: E501 + + Conditions contains the latest observation of the device's state. If the device has been configured according to the class and claim config references, the `Ready` condition should be True. Must not contain more than 8 entries. # noqa: E501 + + :return: The conditions of this V1AllocatedDeviceStatus. # noqa: E501 + :rtype: list[V1Condition] + """ + return self._conditions + + @conditions.setter + def conditions(self, conditions): + """Sets the conditions of this V1AllocatedDeviceStatus. + + Conditions contains the latest observation of the device's state. If the device has been configured according to the class and claim config references, the `Ready` condition should be True. Must not contain more than 8 entries. # noqa: E501 + + :param conditions: The conditions of this V1AllocatedDeviceStatus. # noqa: E501 + :type conditions: list[V1Condition] + """ + + self._conditions = conditions + + @property + def data(self): + """Gets the data of this V1AllocatedDeviceStatus. # noqa: E501 + + Data contains arbitrary driver-specific data. The length of the raw data must be smaller or equal to 10 Ki. # noqa: E501 + + :return: The data of this V1AllocatedDeviceStatus. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this V1AllocatedDeviceStatus. + + Data contains arbitrary driver-specific data. The length of the raw data must be smaller or equal to 10 Ki. # noqa: E501 + + :param data: The data of this V1AllocatedDeviceStatus. # noqa: E501 + :type data: object + """ + + self._data = data + + @property + def device(self): + """Gets the device of this V1AllocatedDeviceStatus. # noqa: E501 + + Device references one device instance via its name in the driver's resource pool. It must be a DNS label. # noqa: E501 + + :return: The device of this V1AllocatedDeviceStatus. # noqa: E501 + :rtype: str + """ + return self._device + + @device.setter + def device(self, device): + """Sets the device of this V1AllocatedDeviceStatus. + + Device references one device instance via its name in the driver's resource pool. It must be a DNS label. # noqa: E501 + + :param device: The device of this V1AllocatedDeviceStatus. # noqa: E501 + :type device: str + """ + if self.local_vars_configuration.client_side_validation and device is None: # noqa: E501 + raise ValueError("Invalid value for `device`, must not be `None`") # noqa: E501 + + self._device = device + + @property + def driver(self): + """Gets the driver of this V1AllocatedDeviceStatus. # noqa: E501 + + Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. It should use only lower case characters. # noqa: E501 + + :return: The driver of this V1AllocatedDeviceStatus. # noqa: E501 + :rtype: str + """ + return self._driver + + @driver.setter + def driver(self, driver): + """Sets the driver of this V1AllocatedDeviceStatus. + + Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. It should use only lower case characters. # noqa: E501 + + :param driver: The driver of this V1AllocatedDeviceStatus. # noqa: E501 + :type driver: str + """ + if self.local_vars_configuration.client_side_validation and driver is None: # noqa: E501 + raise ValueError("Invalid value for `driver`, must not be `None`") # noqa: E501 + + self._driver = driver + + @property + def network_data(self): + """Gets the network_data of this V1AllocatedDeviceStatus. # noqa: E501 + + + :return: The network_data of this V1AllocatedDeviceStatus. # noqa: E501 + :rtype: V1NetworkDeviceData + """ + return self._network_data + + @network_data.setter + def network_data(self, network_data): + """Sets the network_data of this V1AllocatedDeviceStatus. + + + :param network_data: The network_data of this V1AllocatedDeviceStatus. # noqa: E501 + :type network_data: V1NetworkDeviceData + """ + + self._network_data = network_data + + @property + def pool(self): + """Gets the pool of this V1AllocatedDeviceStatus. # noqa: E501 + + This name together with the driver name and the device name field identify which device was allocated (`//`). Must not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes. # noqa: E501 + + :return: The pool of this V1AllocatedDeviceStatus. # noqa: E501 + :rtype: str + """ + return self._pool + + @pool.setter + def pool(self, pool): + """Sets the pool of this V1AllocatedDeviceStatus. + + This name together with the driver name and the device name field identify which device was allocated (`//`). Must not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes. # noqa: E501 + + :param pool: The pool of this V1AllocatedDeviceStatus. # noqa: E501 + :type pool: str + """ + if self.local_vars_configuration.client_side_validation and pool is None: # noqa: E501 + raise ValueError("Invalid value for `pool`, must not be `None`") # noqa: E501 + + self._pool = pool + + @property + def share_id(self): + """Gets the share_id of this V1AllocatedDeviceStatus. # noqa: E501 + + ShareID uniquely identifies an individual allocation share of the device. # noqa: E501 + + :return: The share_id of this V1AllocatedDeviceStatus. # noqa: E501 + :rtype: str + """ + return self._share_id + + @share_id.setter + def share_id(self, share_id): + """Sets the share_id of this V1AllocatedDeviceStatus. + + ShareID uniquely identifies an individual allocation share of the device. # noqa: E501 + + :param share_id: The share_id of this V1AllocatedDeviceStatus. # noqa: E501 + :type share_id: str + """ + + self._share_id = share_id + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1AllocatedDeviceStatus): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1AllocatedDeviceStatus): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_allocation_result.py b/kubernetes_asyncio/client/models/v1_allocation_result.py new file mode 100644 index 0000000000..9ac94e8c81 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_allocation_result.py @@ -0,0 +1,185 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1AllocationResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'allocation_timestamp': 'datetime', + 'devices': 'V1DeviceAllocationResult', + 'node_selector': 'V1NodeSelector' + } + + attribute_map = { + 'allocation_timestamp': 'allocationTimestamp', + 'devices': 'devices', + 'node_selector': 'nodeSelector' + } + + def __init__(self, allocation_timestamp=None, devices=None, node_selector=None, local_vars_configuration=None): # noqa: E501 + """V1AllocationResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._allocation_timestamp = None + self._devices = None + self._node_selector = None + self.discriminator = None + + if allocation_timestamp is not None: + self.allocation_timestamp = allocation_timestamp + if devices is not None: + self.devices = devices + if node_selector is not None: + self.node_selector = node_selector + + @property + def allocation_timestamp(self): + """Gets the allocation_timestamp of this V1AllocationResult. # noqa: E501 + + AllocationTimestamp stores the time when the resources were allocated. This field is not guaranteed to be set, in which case that time is unknown. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gate. # noqa: E501 + + :return: The allocation_timestamp of this V1AllocationResult. # noqa: E501 + :rtype: datetime + """ + return self._allocation_timestamp + + @allocation_timestamp.setter + def allocation_timestamp(self, allocation_timestamp): + """Sets the allocation_timestamp of this V1AllocationResult. + + AllocationTimestamp stores the time when the resources were allocated. This field is not guaranteed to be set, in which case that time is unknown. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gate. # noqa: E501 + + :param allocation_timestamp: The allocation_timestamp of this V1AllocationResult. # noqa: E501 + :type allocation_timestamp: datetime + """ + + self._allocation_timestamp = allocation_timestamp + + @property + def devices(self): + """Gets the devices of this V1AllocationResult. # noqa: E501 + + + :return: The devices of this V1AllocationResult. # noqa: E501 + :rtype: V1DeviceAllocationResult + """ + return self._devices + + @devices.setter + def devices(self, devices): + """Sets the devices of this V1AllocationResult. + + + :param devices: The devices of this V1AllocationResult. # noqa: E501 + :type devices: V1DeviceAllocationResult + """ + + self._devices = devices + + @property + def node_selector(self): + """Gets the node_selector of this V1AllocationResult. # noqa: E501 + + + :return: The node_selector of this V1AllocationResult. # noqa: E501 + :rtype: V1NodeSelector + """ + return self._node_selector + + @node_selector.setter + def node_selector(self, node_selector): + """Sets the node_selector of this V1AllocationResult. + + + :param node_selector: The node_selector of this V1AllocationResult. # noqa: E501 + :type node_selector: V1NodeSelector + """ + + self._node_selector = node_selector + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1AllocationResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1AllocationResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_api_group.py b/kubernetes_asyncio/client/models/v1_api_group.py new file mode 100644 index 0000000000..e07839e4b8 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_api_group.py @@ -0,0 +1,273 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1APIGroup(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'name': 'str', + 'preferred_version': 'V1GroupVersionForDiscovery', + 'server_address_by_client_cidrs': 'list[V1ServerAddressByClientCIDR]', + 'versions': 'list[V1GroupVersionForDiscovery]' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'name': 'name', + 'preferred_version': 'preferredVersion', + 'server_address_by_client_cidrs': 'serverAddressByClientCIDRs', + 'versions': 'versions' + } + + def __init__(self, api_version=None, kind=None, name=None, preferred_version=None, server_address_by_client_cidrs=None, versions=None, local_vars_configuration=None): # noqa: E501 + """V1APIGroup - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._name = None + self._preferred_version = None + self._server_address_by_client_cidrs = None + self._versions = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + self.name = name + if preferred_version is not None: + self.preferred_version = preferred_version + if server_address_by_client_cidrs is not None: + self.server_address_by_client_cidrs = server_address_by_client_cidrs + self.versions = versions + + @property + def api_version(self): + """Gets the api_version of this V1APIGroup. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1APIGroup. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1APIGroup. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1APIGroup. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1APIGroup. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1APIGroup. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1APIGroup. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1APIGroup. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def name(self): + """Gets the name of this V1APIGroup. # noqa: E501 + + name is the name of the group. # noqa: E501 + + :return: The name of this V1APIGroup. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1APIGroup. + + name is the name of the group. # noqa: E501 + + :param name: The name of this V1APIGroup. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def preferred_version(self): + """Gets the preferred_version of this V1APIGroup. # noqa: E501 + + + :return: The preferred_version of this V1APIGroup. # noqa: E501 + :rtype: V1GroupVersionForDiscovery + """ + return self._preferred_version + + @preferred_version.setter + def preferred_version(self, preferred_version): + """Sets the preferred_version of this V1APIGroup. + + + :param preferred_version: The preferred_version of this V1APIGroup. # noqa: E501 + :type preferred_version: V1GroupVersionForDiscovery + """ + + self._preferred_version = preferred_version + + @property + def server_address_by_client_cidrs(self): + """Gets the server_address_by_client_cidrs of this V1APIGroup. # noqa: E501 + + a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. # noqa: E501 + + :return: The server_address_by_client_cidrs of this V1APIGroup. # noqa: E501 + :rtype: list[V1ServerAddressByClientCIDR] + """ + return self._server_address_by_client_cidrs + + @server_address_by_client_cidrs.setter + def server_address_by_client_cidrs(self, server_address_by_client_cidrs): + """Sets the server_address_by_client_cidrs of this V1APIGroup. + + a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. # noqa: E501 + + :param server_address_by_client_cidrs: The server_address_by_client_cidrs of this V1APIGroup. # noqa: E501 + :type server_address_by_client_cidrs: list[V1ServerAddressByClientCIDR] + """ + + self._server_address_by_client_cidrs = server_address_by_client_cidrs + + @property + def versions(self): + """Gets the versions of this V1APIGroup. # noqa: E501 + + versions are the versions supported in this group. # noqa: E501 + + :return: The versions of this V1APIGroup. # noqa: E501 + :rtype: list[V1GroupVersionForDiscovery] + """ + return self._versions + + @versions.setter + def versions(self, versions): + """Sets the versions of this V1APIGroup. + + versions are the versions supported in this group. # noqa: E501 + + :param versions: The versions of this V1APIGroup. # noqa: E501 + :type versions: list[V1GroupVersionForDiscovery] + """ + if self.local_vars_configuration.client_side_validation and versions is None: # noqa: E501 + raise ValueError("Invalid value for `versions`, must not be `None`") # noqa: E501 + + self._versions = versions + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1APIGroup): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1APIGroup): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_api_group_list.py b/kubernetes_asyncio/client/models/v1_api_group_list.py new file mode 100644 index 0000000000..955ddb151b --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_api_group_list.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1APIGroupList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'groups': 'list[V1APIGroup]', + 'kind': 'str' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'groups': 'groups', + 'kind': 'kind' + } + + def __init__(self, api_version=None, groups=None, kind=None, local_vars_configuration=None): # noqa: E501 + """V1APIGroupList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._groups = None + self._kind = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.groups = groups + if kind is not None: + self.kind = kind + + @property + def api_version(self): + """Gets the api_version of this V1APIGroupList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1APIGroupList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1APIGroupList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1APIGroupList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def groups(self): + """Gets the groups of this V1APIGroupList. # noqa: E501 + + groups is a list of APIGroup. # noqa: E501 + + :return: The groups of this V1APIGroupList. # noqa: E501 + :rtype: list[V1APIGroup] + """ + return self._groups + + @groups.setter + def groups(self, groups): + """Sets the groups of this V1APIGroupList. + + groups is a list of APIGroup. # noqa: E501 + + :param groups: The groups of this V1APIGroupList. # noqa: E501 + :type groups: list[V1APIGroup] + """ + if self.local_vars_configuration.client_side_validation and groups is None: # noqa: E501 + raise ValueError("Invalid value for `groups`, must not be `None`") # noqa: E501 + + self._groups = groups + + @property + def kind(self): + """Gets the kind of this V1APIGroupList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1APIGroupList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1APIGroupList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1APIGroupList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1APIGroupList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1APIGroupList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_api_resource.py b/kubernetes_asyncio/client/models/v1_api_resource.py new file mode 100644 index 0000000000..1a89a356ff --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_api_resource.py @@ -0,0 +1,390 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1APIResource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'categories': 'list[str]', + 'group': 'str', + 'kind': 'str', + 'name': 'str', + 'namespaced': 'bool', + 'short_names': 'list[str]', + 'singular_name': 'str', + 'storage_version_hash': 'str', + 'verbs': 'list[str]', + 'version': 'str' + } + + attribute_map = { + 'categories': 'categories', + 'group': 'group', + 'kind': 'kind', + 'name': 'name', + 'namespaced': 'namespaced', + 'short_names': 'shortNames', + 'singular_name': 'singularName', + 'storage_version_hash': 'storageVersionHash', + 'verbs': 'verbs', + 'version': 'version' + } + + def __init__(self, categories=None, group=None, kind=None, name=None, namespaced=None, short_names=None, singular_name=None, storage_version_hash=None, verbs=None, version=None, local_vars_configuration=None): # noqa: E501 + """V1APIResource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._categories = None + self._group = None + self._kind = None + self._name = None + self._namespaced = None + self._short_names = None + self._singular_name = None + self._storage_version_hash = None + self._verbs = None + self._version = None + self.discriminator = None + + if categories is not None: + self.categories = categories + if group is not None: + self.group = group + self.kind = kind + self.name = name + self.namespaced = namespaced + if short_names is not None: + self.short_names = short_names + self.singular_name = singular_name + if storage_version_hash is not None: + self.storage_version_hash = storage_version_hash + self.verbs = verbs + if version is not None: + self.version = version + + @property + def categories(self): + """Gets the categories of this V1APIResource. # noqa: E501 + + categories is a list of the grouped resources this resource belongs to (e.g. 'all') # noqa: E501 + + :return: The categories of this V1APIResource. # noqa: E501 + :rtype: list[str] + """ + return self._categories + + @categories.setter + def categories(self, categories): + """Sets the categories of this V1APIResource. + + categories is a list of the grouped resources this resource belongs to (e.g. 'all') # noqa: E501 + + :param categories: The categories of this V1APIResource. # noqa: E501 + :type categories: list[str] + """ + + self._categories = categories + + @property + def group(self): + """Gets the group of this V1APIResource. # noqa: E501 + + group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\". # noqa: E501 + + :return: The group of this V1APIResource. # noqa: E501 + :rtype: str + """ + return self._group + + @group.setter + def group(self, group): + """Sets the group of this V1APIResource. + + group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\". # noqa: E501 + + :param group: The group of this V1APIResource. # noqa: E501 + :type group: str + """ + + self._group = group + + @property + def kind(self): + """Gets the kind of this V1APIResource. # noqa: E501 + + kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo') # noqa: E501 + + :return: The kind of this V1APIResource. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1APIResource. + + kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo') # noqa: E501 + + :param kind: The kind of this V1APIResource. # noqa: E501 + :type kind: str + """ + if self.local_vars_configuration.client_side_validation and kind is None: # noqa: E501 + raise ValueError("Invalid value for `kind`, must not be `None`") # noqa: E501 + + self._kind = kind + + @property + def name(self): + """Gets the name of this V1APIResource. # noqa: E501 + + name is the plural name of the resource. # noqa: E501 + + :return: The name of this V1APIResource. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1APIResource. + + name is the plural name of the resource. # noqa: E501 + + :param name: The name of this V1APIResource. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def namespaced(self): + """Gets the namespaced of this V1APIResource. # noqa: E501 + + namespaced indicates if a resource is namespaced or not. # noqa: E501 + + :return: The namespaced of this V1APIResource. # noqa: E501 + :rtype: bool + """ + return self._namespaced + + @namespaced.setter + def namespaced(self, namespaced): + """Sets the namespaced of this V1APIResource. + + namespaced indicates if a resource is namespaced or not. # noqa: E501 + + :param namespaced: The namespaced of this V1APIResource. # noqa: E501 + :type namespaced: bool + """ + if self.local_vars_configuration.client_side_validation and namespaced is None: # noqa: E501 + raise ValueError("Invalid value for `namespaced`, must not be `None`") # noqa: E501 + + self._namespaced = namespaced + + @property + def short_names(self): + """Gets the short_names of this V1APIResource. # noqa: E501 + + shortNames is a list of suggested short names of the resource. # noqa: E501 + + :return: The short_names of this V1APIResource. # noqa: E501 + :rtype: list[str] + """ + return self._short_names + + @short_names.setter + def short_names(self, short_names): + """Sets the short_names of this V1APIResource. + + shortNames is a list of suggested short names of the resource. # noqa: E501 + + :param short_names: The short_names of this V1APIResource. # noqa: E501 + :type short_names: list[str] + """ + + self._short_names = short_names + + @property + def singular_name(self): + """Gets the singular_name of this V1APIResource. # noqa: E501 + + singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface. # noqa: E501 + + :return: The singular_name of this V1APIResource. # noqa: E501 + :rtype: str + """ + return self._singular_name + + @singular_name.setter + def singular_name(self, singular_name): + """Sets the singular_name of this V1APIResource. + + singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface. # noqa: E501 + + :param singular_name: The singular_name of this V1APIResource. # noqa: E501 + :type singular_name: str + """ + if self.local_vars_configuration.client_side_validation and singular_name is None: # noqa: E501 + raise ValueError("Invalid value for `singular_name`, must not be `None`") # noqa: E501 + + self._singular_name = singular_name + + @property + def storage_version_hash(self): + """Gets the storage_version_hash of this V1APIResource. # noqa: E501 + + The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates. # noqa: E501 + + :return: The storage_version_hash of this V1APIResource. # noqa: E501 + :rtype: str + """ + return self._storage_version_hash + + @storage_version_hash.setter + def storage_version_hash(self, storage_version_hash): + """Sets the storage_version_hash of this V1APIResource. + + The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates. # noqa: E501 + + :param storage_version_hash: The storage_version_hash of this V1APIResource. # noqa: E501 + :type storage_version_hash: str + """ + + self._storage_version_hash = storage_version_hash + + @property + def verbs(self): + """Gets the verbs of this V1APIResource. # noqa: E501 + + verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy) # noqa: E501 + + :return: The verbs of this V1APIResource. # noqa: E501 + :rtype: list[str] + """ + return self._verbs + + @verbs.setter + def verbs(self, verbs): + """Sets the verbs of this V1APIResource. + + verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy) # noqa: E501 + + :param verbs: The verbs of this V1APIResource. # noqa: E501 + :type verbs: list[str] + """ + if self.local_vars_configuration.client_side_validation and verbs is None: # noqa: E501 + raise ValueError("Invalid value for `verbs`, must not be `None`") # noqa: E501 + + self._verbs = verbs + + @property + def version(self): + """Gets the version of this V1APIResource. # noqa: E501 + + version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\". # noqa: E501 + + :return: The version of this V1APIResource. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this V1APIResource. + + version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\". # noqa: E501 + + :param version: The version of this V1APIResource. # noqa: E501 + :type version: str + """ + + self._version = version + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1APIResource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1APIResource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_api_resource_list.py b/kubernetes_asyncio/client/models/v1_api_resource_list.py new file mode 100644 index 0000000000..7a1dda33b4 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_api_resource_list.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1APIResourceList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'group_version': 'str', + 'kind': 'str', + 'resources': 'list[V1APIResource]' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'group_version': 'groupVersion', + 'kind': 'kind', + 'resources': 'resources' + } + + def __init__(self, api_version=None, group_version=None, kind=None, resources=None, local_vars_configuration=None): # noqa: E501 + """V1APIResourceList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._group_version = None + self._kind = None + self._resources = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.group_version = group_version + if kind is not None: + self.kind = kind + self.resources = resources + + @property + def api_version(self): + """Gets the api_version of this V1APIResourceList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1APIResourceList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1APIResourceList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1APIResourceList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def group_version(self): + """Gets the group_version of this V1APIResourceList. # noqa: E501 + + groupVersion is the group and version this APIResourceList is for. # noqa: E501 + + :return: The group_version of this V1APIResourceList. # noqa: E501 + :rtype: str + """ + return self._group_version + + @group_version.setter + def group_version(self, group_version): + """Sets the group_version of this V1APIResourceList. + + groupVersion is the group and version this APIResourceList is for. # noqa: E501 + + :param group_version: The group_version of this V1APIResourceList. # noqa: E501 + :type group_version: str + """ + if self.local_vars_configuration.client_side_validation and group_version is None: # noqa: E501 + raise ValueError("Invalid value for `group_version`, must not be `None`") # noqa: E501 + + self._group_version = group_version + + @property + def kind(self): + """Gets the kind of this V1APIResourceList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1APIResourceList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1APIResourceList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1APIResourceList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def resources(self): + """Gets the resources of this V1APIResourceList. # noqa: E501 + + resources contains the name of the resources and if they are namespaced. # noqa: E501 + + :return: The resources of this V1APIResourceList. # noqa: E501 + :rtype: list[V1APIResource] + """ + return self._resources + + @resources.setter + def resources(self, resources): + """Sets the resources of this V1APIResourceList. + + resources contains the name of the resources and if they are namespaced. # noqa: E501 + + :param resources: The resources of this V1APIResourceList. # noqa: E501 + :type resources: list[V1APIResource] + """ + if self.local_vars_configuration.client_side_validation and resources is None: # noqa: E501 + raise ValueError("Invalid value for `resources`, must not be `None`") # noqa: E501 + + self._resources = resources + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1APIResourceList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1APIResourceList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_api_service.py b/kubernetes_asyncio/client/models/v1_api_service.py new file mode 100644 index 0000000000..1ba94597aa --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_api_service.py @@ -0,0 +1,239 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1APIService(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'spec': 'V1APIServiceSpec', + 'status': 'V1APIServiceStatus' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'spec': 'spec', + 'status': 'status' + } + + def __init__(self, api_version=None, kind=None, metadata=None, spec=None, status=None, local_vars_configuration=None): # noqa: E501 + """V1APIService - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._metadata = None + self._spec = None + self._status = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + if spec is not None: + self.spec = spec + if status is not None: + self.status = status + + @property + def api_version(self): + """Gets the api_version of this V1APIService. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1APIService. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1APIService. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1APIService. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1APIService. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1APIService. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1APIService. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1APIService. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1APIService. # noqa: E501 + + + :return: The metadata of this V1APIService. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1APIService. + + + :param metadata: The metadata of this V1APIService. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def spec(self): + """Gets the spec of this V1APIService. # noqa: E501 + + + :return: The spec of this V1APIService. # noqa: E501 + :rtype: V1APIServiceSpec + """ + return self._spec + + @spec.setter + def spec(self, spec): + """Sets the spec of this V1APIService. + + + :param spec: The spec of this V1APIService. # noqa: E501 + :type spec: V1APIServiceSpec + """ + + self._spec = spec + + @property + def status(self): + """Gets the status of this V1APIService. # noqa: E501 + + + :return: The status of this V1APIService. # noqa: E501 + :rtype: V1APIServiceStatus + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1APIService. + + + :param status: The status of this V1APIService. # noqa: E501 + :type status: V1APIServiceStatus + """ + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1APIService): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1APIService): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_api_service_condition.py b/kubernetes_asyncio/client/models/v1_api_service_condition.py new file mode 100644 index 0000000000..b9a72810a1 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_api_service_condition.py @@ -0,0 +1,247 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1APIServiceCondition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'last_transition_time': 'datetime', + 'message': 'str', + 'reason': 'str', + 'status': 'str', + 'type': 'str' + } + + attribute_map = { + 'last_transition_time': 'lastTransitionTime', + 'message': 'message', + 'reason': 'reason', + 'status': 'status', + 'type': 'type' + } + + def __init__(self, last_transition_time=None, message=None, reason=None, status=None, type=None, local_vars_configuration=None): # noqa: E501 + """V1APIServiceCondition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._last_transition_time = None + self._message = None + self._reason = None + self._status = None + self._type = None + self.discriminator = None + + if last_transition_time is not None: + self.last_transition_time = last_transition_time + if message is not None: + self.message = message + if reason is not None: + self.reason = reason + self.status = status + self.type = type + + @property + def last_transition_time(self): + """Gets the last_transition_time of this V1APIServiceCondition. # noqa: E501 + + Last time the condition transitioned from one status to another. # noqa: E501 + + :return: The last_transition_time of this V1APIServiceCondition. # noqa: E501 + :rtype: datetime + """ + return self._last_transition_time + + @last_transition_time.setter + def last_transition_time(self, last_transition_time): + """Sets the last_transition_time of this V1APIServiceCondition. + + Last time the condition transitioned from one status to another. # noqa: E501 + + :param last_transition_time: The last_transition_time of this V1APIServiceCondition. # noqa: E501 + :type last_transition_time: datetime + """ + + self._last_transition_time = last_transition_time + + @property + def message(self): + """Gets the message of this V1APIServiceCondition. # noqa: E501 + + Human-readable message indicating details about last transition. # noqa: E501 + + :return: The message of this V1APIServiceCondition. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this V1APIServiceCondition. + + Human-readable message indicating details about last transition. # noqa: E501 + + :param message: The message of this V1APIServiceCondition. # noqa: E501 + :type message: str + """ + + self._message = message + + @property + def reason(self): + """Gets the reason of this V1APIServiceCondition. # noqa: E501 + + Unique, one-word, CamelCase reason for the condition's last transition. # noqa: E501 + + :return: The reason of this V1APIServiceCondition. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this V1APIServiceCondition. + + Unique, one-word, CamelCase reason for the condition's last transition. # noqa: E501 + + :param reason: The reason of this V1APIServiceCondition. # noqa: E501 + :type reason: str + """ + + self._reason = reason + + @property + def status(self): + """Gets the status of this V1APIServiceCondition. # noqa: E501 + + Status is the status of the condition. Can be True, False, Unknown. # noqa: E501 + + :return: The status of this V1APIServiceCondition. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1APIServiceCondition. + + Status is the status of the condition. Can be True, False, Unknown. # noqa: E501 + + :param status: The status of this V1APIServiceCondition. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def type(self): + """Gets the type of this V1APIServiceCondition. # noqa: E501 + + Type is the type of the condition. # noqa: E501 + + :return: The type of this V1APIServiceCondition. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this V1APIServiceCondition. + + Type is the type of the condition. # noqa: E501 + + :param type: The type of this V1APIServiceCondition. # noqa: E501 + :type type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1APIServiceCondition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1APIServiceCondition): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_api_service_list.py b/kubernetes_asyncio/client/models/v1_api_service_list.py new file mode 100644 index 0000000000..220a9e529a --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_api_service_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1APIServiceList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1APIService]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1APIServiceList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1APIServiceList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1APIServiceList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1APIServiceList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1APIServiceList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1APIServiceList. # noqa: E501 + + Items is the list of APIService # noqa: E501 + + :return: The items of this V1APIServiceList. # noqa: E501 + :rtype: list[V1APIService] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1APIServiceList. + + Items is the list of APIService # noqa: E501 + + :param items: The items of this V1APIServiceList. # noqa: E501 + :type items: list[V1APIService] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1APIServiceList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1APIServiceList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1APIServiceList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1APIServiceList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1APIServiceList. # noqa: E501 + + + :return: The metadata of this V1APIServiceList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1APIServiceList. + + + :param metadata: The metadata of this V1APIServiceList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1APIServiceList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1APIServiceList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_api_service_spec.py b/kubernetes_asyncio/client/models/v1_api_service_spec.py new file mode 100644 index 0000000000..0aba176baf --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_api_service_spec.py @@ -0,0 +1,304 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1APIServiceSpec(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'ca_bundle': 'str', + 'group': 'str', + 'group_priority_minimum': 'int', + 'insecure_skip_tls_verify': 'bool', + 'service': 'ApiregistrationV1ServiceReference', + 'version': 'str', + 'version_priority': 'int' + } + + attribute_map = { + 'ca_bundle': 'caBundle', + 'group': 'group', + 'group_priority_minimum': 'groupPriorityMinimum', + 'insecure_skip_tls_verify': 'insecureSkipTLSVerify', + 'service': 'service', + 'version': 'version', + 'version_priority': 'versionPriority' + } + + def __init__(self, ca_bundle=None, group=None, group_priority_minimum=None, insecure_skip_tls_verify=None, service=None, version=None, version_priority=None, local_vars_configuration=None): # noqa: E501 + """V1APIServiceSpec - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._ca_bundle = None + self._group = None + self._group_priority_minimum = None + self._insecure_skip_tls_verify = None + self._service = None + self._version = None + self._version_priority = None + self.discriminator = None + + if ca_bundle is not None: + self.ca_bundle = ca_bundle + if group is not None: + self.group = group + self.group_priority_minimum = group_priority_minimum + if insecure_skip_tls_verify is not None: + self.insecure_skip_tls_verify = insecure_skip_tls_verify + if service is not None: + self.service = service + if version is not None: + self.version = version + self.version_priority = version_priority + + @property + def ca_bundle(self): + """Gets the ca_bundle of this V1APIServiceSpec. # noqa: E501 + + CABundle is a PEM encoded CA bundle which will be used to validate an API server's serving certificate. If unspecified, system trust roots on the apiserver are used. # noqa: E501 + + :return: The ca_bundle of this V1APIServiceSpec. # noqa: E501 + :rtype: str + """ + return self._ca_bundle + + @ca_bundle.setter + def ca_bundle(self, ca_bundle): + """Sets the ca_bundle of this V1APIServiceSpec. + + CABundle is a PEM encoded CA bundle which will be used to validate an API server's serving certificate. If unspecified, system trust roots on the apiserver are used. # noqa: E501 + + :param ca_bundle: The ca_bundle of this V1APIServiceSpec. # noqa: E501 + :type ca_bundle: str + """ + if (self.local_vars_configuration.client_side_validation and + ca_bundle is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', ca_bundle)): # noqa: E501 + raise ValueError(r"Invalid value for `ca_bundle`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 + + self._ca_bundle = ca_bundle + + @property + def group(self): + """Gets the group of this V1APIServiceSpec. # noqa: E501 + + Group is the API group name this server hosts # noqa: E501 + + :return: The group of this V1APIServiceSpec. # noqa: E501 + :rtype: str + """ + return self._group + + @group.setter + def group(self, group): + """Sets the group of this V1APIServiceSpec. + + Group is the API group name this server hosts # noqa: E501 + + :param group: The group of this V1APIServiceSpec. # noqa: E501 + :type group: str + """ + + self._group = group + + @property + def group_priority_minimum(self): + """Gets the group_priority_minimum of this V1APIServiceSpec. # noqa: E501 + + GroupPriorityMinimum is the priority this group should have at least. Higher priority means that the group is preferred by clients over lower priority ones. Note that other versions of this group might specify even higher GroupPriorityMinimum values such that the whole group gets a higher priority. The primary sort is based on GroupPriorityMinimum, ordered highest number to lowest (20 before 10). The secondary sort is based on the alphabetical comparison of the name of the object. (v1.bar before v1.foo) We'd recommend something like: *.k8s.io (except extensions) at 18000 and PaaSes (OpenShift, Deis) are recommended to be in the 2000s # noqa: E501 + + :return: The group_priority_minimum of this V1APIServiceSpec. # noqa: E501 + :rtype: int + """ + return self._group_priority_minimum + + @group_priority_minimum.setter + def group_priority_minimum(self, group_priority_minimum): + """Sets the group_priority_minimum of this V1APIServiceSpec. + + GroupPriorityMinimum is the priority this group should have at least. Higher priority means that the group is preferred by clients over lower priority ones. Note that other versions of this group might specify even higher GroupPriorityMinimum values such that the whole group gets a higher priority. The primary sort is based on GroupPriorityMinimum, ordered highest number to lowest (20 before 10). The secondary sort is based on the alphabetical comparison of the name of the object. (v1.bar before v1.foo) We'd recommend something like: *.k8s.io (except extensions) at 18000 and PaaSes (OpenShift, Deis) are recommended to be in the 2000s # noqa: E501 + + :param group_priority_minimum: The group_priority_minimum of this V1APIServiceSpec. # noqa: E501 + :type group_priority_minimum: int + """ + if self.local_vars_configuration.client_side_validation and group_priority_minimum is None: # noqa: E501 + raise ValueError("Invalid value for `group_priority_minimum`, must not be `None`") # noqa: E501 + + self._group_priority_minimum = group_priority_minimum + + @property + def insecure_skip_tls_verify(self): + """Gets the insecure_skip_tls_verify of this V1APIServiceSpec. # noqa: E501 + + InsecureSkipTLSVerify disables TLS certificate verification when communicating with this server. This is strongly discouraged. You should use the CABundle instead. # noqa: E501 + + :return: The insecure_skip_tls_verify of this V1APIServiceSpec. # noqa: E501 + :rtype: bool + """ + return self._insecure_skip_tls_verify + + @insecure_skip_tls_verify.setter + def insecure_skip_tls_verify(self, insecure_skip_tls_verify): + """Sets the insecure_skip_tls_verify of this V1APIServiceSpec. + + InsecureSkipTLSVerify disables TLS certificate verification when communicating with this server. This is strongly discouraged. You should use the CABundle instead. # noqa: E501 + + :param insecure_skip_tls_verify: The insecure_skip_tls_verify of this V1APIServiceSpec. # noqa: E501 + :type insecure_skip_tls_verify: bool + """ + + self._insecure_skip_tls_verify = insecure_skip_tls_verify + + @property + def service(self): + """Gets the service of this V1APIServiceSpec. # noqa: E501 + + + :return: The service of this V1APIServiceSpec. # noqa: E501 + :rtype: ApiregistrationV1ServiceReference + """ + return self._service + + @service.setter + def service(self, service): + """Sets the service of this V1APIServiceSpec. + + + :param service: The service of this V1APIServiceSpec. # noqa: E501 + :type service: ApiregistrationV1ServiceReference + """ + + self._service = service + + @property + def version(self): + """Gets the version of this V1APIServiceSpec. # noqa: E501 + + Version is the API version this server hosts. For example, \"v1\" # noqa: E501 + + :return: The version of this V1APIServiceSpec. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this V1APIServiceSpec. + + Version is the API version this server hosts. For example, \"v1\" # noqa: E501 + + :param version: The version of this V1APIServiceSpec. # noqa: E501 + :type version: str + """ + + self._version = version + + @property + def version_priority(self): + """Gets the version_priority of this V1APIServiceSpec. # noqa: E501 + + VersionPriority controls the ordering of this API version inside of its group. Must be greater than zero. The primary sort is based on VersionPriority, ordered highest to lowest (20 before 10). Since it's inside of a group, the number can be small, probably in the 10s. In case of equal version priorities, the version string will be used to compute the order inside a group. If the version string is \"kube-like\", it will sort above non \"kube-like\" version strings, which are ordered lexicographically. \"Kube-like\" versions start with a \"v\", then are followed by a number (the major version), then optionally the string \"alpha\" or \"beta\" and another number (the minor version). These are sorted first by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing major version, then minor version. An example sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10. # noqa: E501 + + :return: The version_priority of this V1APIServiceSpec. # noqa: E501 + :rtype: int + """ + return self._version_priority + + @version_priority.setter + def version_priority(self, version_priority): + """Sets the version_priority of this V1APIServiceSpec. + + VersionPriority controls the ordering of this API version inside of its group. Must be greater than zero. The primary sort is based on VersionPriority, ordered highest to lowest (20 before 10). Since it's inside of a group, the number can be small, probably in the 10s. In case of equal version priorities, the version string will be used to compute the order inside a group. If the version string is \"kube-like\", it will sort above non \"kube-like\" version strings, which are ordered lexicographically. \"Kube-like\" versions start with a \"v\", then are followed by a number (the major version), then optionally the string \"alpha\" or \"beta\" and another number (the minor version). These are sorted first by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing major version, then minor version. An example sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10. # noqa: E501 + + :param version_priority: The version_priority of this V1APIServiceSpec. # noqa: E501 + :type version_priority: int + """ + if self.local_vars_configuration.client_side_validation and version_priority is None: # noqa: E501 + raise ValueError("Invalid value for `version_priority`, must not be `None`") # noqa: E501 + + self._version_priority = version_priority + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1APIServiceSpec): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1APIServiceSpec): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_api_service_status.py b/kubernetes_asyncio/client/models/v1_api_service_status.py new file mode 100644 index 0000000000..ada2d3a70f --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_api_service_status.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1APIServiceStatus(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'conditions': 'list[V1APIServiceCondition]' + } + + attribute_map = { + 'conditions': 'conditions' + } + + def __init__(self, conditions=None, local_vars_configuration=None): # noqa: E501 + """V1APIServiceStatus - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._conditions = None + self.discriminator = None + + if conditions is not None: + self.conditions = conditions + + @property + def conditions(self): + """Gets the conditions of this V1APIServiceStatus. # noqa: E501 + + Current service state of apiService. # noqa: E501 + + :return: The conditions of this V1APIServiceStatus. # noqa: E501 + :rtype: list[V1APIServiceCondition] + """ + return self._conditions + + @conditions.setter + def conditions(self, conditions): + """Sets the conditions of this V1APIServiceStatus. + + Current service state of apiService. # noqa: E501 + + :param conditions: The conditions of this V1APIServiceStatus. # noqa: E501 + :type conditions: list[V1APIServiceCondition] + """ + + self._conditions = conditions + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1APIServiceStatus): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1APIServiceStatus): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_api_versions.py b/kubernetes_asyncio/client/models/v1_api_versions.py new file mode 100644 index 0000000000..c78a3ac21d --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_api_versions.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1APIVersions(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'server_address_by_client_cidrs': 'list[V1ServerAddressByClientCIDR]', + 'versions': 'list[str]' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'server_address_by_client_cidrs': 'serverAddressByClientCIDRs', + 'versions': 'versions' + } + + def __init__(self, api_version=None, kind=None, server_address_by_client_cidrs=None, versions=None, local_vars_configuration=None): # noqa: E501 + """V1APIVersions - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._server_address_by_client_cidrs = None + self._versions = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + self.server_address_by_client_cidrs = server_address_by_client_cidrs + self.versions = versions + + @property + def api_version(self): + """Gets the api_version of this V1APIVersions. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1APIVersions. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1APIVersions. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1APIVersions. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1APIVersions. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1APIVersions. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1APIVersions. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1APIVersions. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def server_address_by_client_cidrs(self): + """Gets the server_address_by_client_cidrs of this V1APIVersions. # noqa: E501 + + a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. # noqa: E501 + + :return: The server_address_by_client_cidrs of this V1APIVersions. # noqa: E501 + :rtype: list[V1ServerAddressByClientCIDR] + """ + return self._server_address_by_client_cidrs + + @server_address_by_client_cidrs.setter + def server_address_by_client_cidrs(self, server_address_by_client_cidrs): + """Sets the server_address_by_client_cidrs of this V1APIVersions. + + a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP. # noqa: E501 + + :param server_address_by_client_cidrs: The server_address_by_client_cidrs of this V1APIVersions. # noqa: E501 + :type server_address_by_client_cidrs: list[V1ServerAddressByClientCIDR] + """ + if self.local_vars_configuration.client_side_validation and server_address_by_client_cidrs is None: # noqa: E501 + raise ValueError("Invalid value for `server_address_by_client_cidrs`, must not be `None`") # noqa: E501 + + self._server_address_by_client_cidrs = server_address_by_client_cidrs + + @property + def versions(self): + """Gets the versions of this V1APIVersions. # noqa: E501 + + versions are the api versions that are available. # noqa: E501 + + :return: The versions of this V1APIVersions. # noqa: E501 + :rtype: list[str] + """ + return self._versions + + @versions.setter + def versions(self, versions): + """Sets the versions of this V1APIVersions. + + versions are the api versions that are available. # noqa: E501 + + :param versions: The versions of this V1APIVersions. # noqa: E501 + :type versions: list[str] + """ + if self.local_vars_configuration.client_side_validation and versions is None: # noqa: E501 + raise ValueError("Invalid value for `versions`, must not be `None`") # noqa: E501 + + self._versions = versions + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1APIVersions): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1APIVersions): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_app_armor_profile.py b/kubernetes_asyncio/client/models/v1_app_armor_profile.py new file mode 100644 index 0000000000..02af0dd6b2 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_app_armor_profile.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1AppArmorProfile(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'localhost_profile': 'str', + 'type': 'str' + } + + attribute_map = { + 'localhost_profile': 'localhostProfile', + 'type': 'type' + } + + def __init__(self, localhost_profile=None, type=None, local_vars_configuration=None): # noqa: E501 + """V1AppArmorProfile - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._localhost_profile = None + self._type = None + self.discriminator = None + + if localhost_profile is not None: + self.localhost_profile = localhost_profile + self.type = type + + @property + def localhost_profile(self): + """Gets the localhost_profile of this V1AppArmorProfile. # noqa: E501 + + localhostProfile indicates a profile loaded on the node that should be used. The profile must be preconfigured on the node to work. Must match the loaded name of the profile. Must be set if and only if type is \"Localhost\". # noqa: E501 + + :return: The localhost_profile of this V1AppArmorProfile. # noqa: E501 + :rtype: str + """ + return self._localhost_profile + + @localhost_profile.setter + def localhost_profile(self, localhost_profile): + """Sets the localhost_profile of this V1AppArmorProfile. + + localhostProfile indicates a profile loaded on the node that should be used. The profile must be preconfigured on the node to work. Must match the loaded name of the profile. Must be set if and only if type is \"Localhost\". # noqa: E501 + + :param localhost_profile: The localhost_profile of this V1AppArmorProfile. # noqa: E501 + :type localhost_profile: str + """ + + self._localhost_profile = localhost_profile + + @property + def type(self): + """Gets the type of this V1AppArmorProfile. # noqa: E501 + + type indicates which kind of AppArmor profile will be applied. Valid options are: Localhost - a profile pre-loaded on the node. RuntimeDefault - the container runtime's default profile. Unconfined - no AppArmor enforcement. # noqa: E501 + + :return: The type of this V1AppArmorProfile. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this V1AppArmorProfile. + + type indicates which kind of AppArmor profile will be applied. Valid options are: Localhost - a profile pre-loaded on the node. RuntimeDefault - the container runtime's default profile. Unconfined - no AppArmor enforcement. # noqa: E501 + + :param type: The type of this V1AppArmorProfile. # noqa: E501 + :type type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1AppArmorProfile): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1AppArmorProfile): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_attached_volume.py b/kubernetes_asyncio/client/models/v1_attached_volume.py new file mode 100644 index 0000000000..fe30f2ca76 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_attached_volume.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1AttachedVolume(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'device_path': 'str', + 'name': 'str' + } + + attribute_map = { + 'device_path': 'devicePath', + 'name': 'name' + } + + def __init__(self, device_path=None, name=None, local_vars_configuration=None): # noqa: E501 + """V1AttachedVolume - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._device_path = None + self._name = None + self.discriminator = None + + self.device_path = device_path + self.name = name + + @property + def device_path(self): + """Gets the device_path of this V1AttachedVolume. # noqa: E501 + + DevicePath represents the device path where the volume should be available # noqa: E501 + + :return: The device_path of this V1AttachedVolume. # noqa: E501 + :rtype: str + """ + return self._device_path + + @device_path.setter + def device_path(self, device_path): + """Sets the device_path of this V1AttachedVolume. + + DevicePath represents the device path where the volume should be available # noqa: E501 + + :param device_path: The device_path of this V1AttachedVolume. # noqa: E501 + :type device_path: str + """ + if self.local_vars_configuration.client_side_validation and device_path is None: # noqa: E501 + raise ValueError("Invalid value for `device_path`, must not be `None`") # noqa: E501 + + self._device_path = device_path + + @property + def name(self): + """Gets the name of this V1AttachedVolume. # noqa: E501 + + Name of the attached volume # noqa: E501 + + :return: The name of this V1AttachedVolume. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1AttachedVolume. + + Name of the attached volume # noqa: E501 + + :param name: The name of this V1AttachedVolume. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1AttachedVolume): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1AttachedVolume): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_audit_annotation.py b/kubernetes_asyncio/client/models/v1_audit_annotation.py new file mode 100644 index 0000000000..1c9db1ab5d --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_audit_annotation.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1AuditAnnotation(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'key': 'str', + 'value_expression': 'str' + } + + attribute_map = { + 'key': 'key', + 'value_expression': 'valueExpression' + } + + def __init__(self, key=None, value_expression=None, local_vars_configuration=None): # noqa: E501 + """V1AuditAnnotation - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._key = None + self._value_expression = None + self.discriminator = None + + self.key = key + self.value_expression = value_expression + + @property + def key(self): + """Gets the key of this V1AuditAnnotation. # noqa: E501 + + key specifies the audit annotation key. The audit annotation keys of a ValidatingAdmissionPolicy must be unique. The key must be a qualified name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length. The key is combined with the resource name of the ValidatingAdmissionPolicy to construct an audit annotation key: \"{ValidatingAdmissionPolicy name}/{key}\". If an admission webhook uses the same resource name as this ValidatingAdmissionPolicy and the same audit annotation key, the annotation key will be identical. In this case, the first annotation written with the key will be included in the audit event and all subsequent annotations with the same key will be discarded. Required. # noqa: E501 + + :return: The key of this V1AuditAnnotation. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this V1AuditAnnotation. + + key specifies the audit annotation key. The audit annotation keys of a ValidatingAdmissionPolicy must be unique. The key must be a qualified name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length. The key is combined with the resource name of the ValidatingAdmissionPolicy to construct an audit annotation key: \"{ValidatingAdmissionPolicy name}/{key}\". If an admission webhook uses the same resource name as this ValidatingAdmissionPolicy and the same audit annotation key, the annotation key will be identical. In this case, the first annotation written with the key will be included in the audit event and all subsequent annotations with the same key will be discarded. Required. # noqa: E501 + + :param key: The key of this V1AuditAnnotation. # noqa: E501 + :type key: str + """ + if self.local_vars_configuration.client_side_validation and key is None: # noqa: E501 + raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501 + + self._key = key + + @property + def value_expression(self): + """Gets the value_expression of this V1AuditAnnotation. # noqa: E501 + + valueExpression represents the expression which is evaluated by CEL to produce an audit annotation value. The expression must evaluate to either a string or null value. If the expression evaluates to a string, the audit annotation is included with the string value. If the expression evaluates to null or empty string the audit annotation will be omitted. The valueExpression may be no longer than 5kb in length. If the result of the valueExpression is more than 10kb in length, it will be truncated to 10kb. If multiple ValidatingAdmissionPolicyBinding resources match an API request, then the valueExpression will be evaluated for each binding. All unique values produced by the valueExpressions will be joined together in a comma-separated list. Required. # noqa: E501 + + :return: The value_expression of this V1AuditAnnotation. # noqa: E501 + :rtype: str + """ + return self._value_expression + + @value_expression.setter + def value_expression(self, value_expression): + """Sets the value_expression of this V1AuditAnnotation. + + valueExpression represents the expression which is evaluated by CEL to produce an audit annotation value. The expression must evaluate to either a string or null value. If the expression evaluates to a string, the audit annotation is included with the string value. If the expression evaluates to null or empty string the audit annotation will be omitted. The valueExpression may be no longer than 5kb in length. If the result of the valueExpression is more than 10kb in length, it will be truncated to 10kb. If multiple ValidatingAdmissionPolicyBinding resources match an API request, then the valueExpression will be evaluated for each binding. All unique values produced by the valueExpressions will be joined together in a comma-separated list. Required. # noqa: E501 + + :param value_expression: The value_expression of this V1AuditAnnotation. # noqa: E501 + :type value_expression: str + """ + if self.local_vars_configuration.client_side_validation and value_expression is None: # noqa: E501 + raise ValueError("Invalid value for `value_expression`, must not be `None`") # noqa: E501 + + self._value_expression = value_expression + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1AuditAnnotation): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1AuditAnnotation): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_aws_elastic_block_store_volume_source.py b/kubernetes_asyncio/client/models/v1_aws_elastic_block_store_volume_source.py new file mode 100644 index 0000000000..1d73d59129 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_aws_elastic_block_store_volume_source.py @@ -0,0 +1,218 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1AWSElasticBlockStoreVolumeSource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'fs_type': 'str', + 'partition': 'int', + 'read_only': 'bool', + 'volume_id': 'str' + } + + attribute_map = { + 'fs_type': 'fsType', + 'partition': 'partition', + 'read_only': 'readOnly', + 'volume_id': 'volumeID' + } + + def __init__(self, fs_type=None, partition=None, read_only=None, volume_id=None, local_vars_configuration=None): # noqa: E501 + """V1AWSElasticBlockStoreVolumeSource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._fs_type = None + self._partition = None + self._read_only = None + self._volume_id = None + self.discriminator = None + + if fs_type is not None: + self.fs_type = fs_type + if partition is not None: + self.partition = partition + if read_only is not None: + self.read_only = read_only + self.volume_id = volume_id + + @property + def fs_type(self): + """Gets the fs_type of this V1AWSElasticBlockStoreVolumeSource. # noqa: E501 + + fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore # noqa: E501 + + :return: The fs_type of this V1AWSElasticBlockStoreVolumeSource. # noqa: E501 + :rtype: str + """ + return self._fs_type + + @fs_type.setter + def fs_type(self, fs_type): + """Sets the fs_type of this V1AWSElasticBlockStoreVolumeSource. + + fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore # noqa: E501 + + :param fs_type: The fs_type of this V1AWSElasticBlockStoreVolumeSource. # noqa: E501 + :type fs_type: str + """ + + self._fs_type = fs_type + + @property + def partition(self): + """Gets the partition of this V1AWSElasticBlockStoreVolumeSource. # noqa: E501 + + partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). # noqa: E501 + + :return: The partition of this V1AWSElasticBlockStoreVolumeSource. # noqa: E501 + :rtype: int + """ + return self._partition + + @partition.setter + def partition(self, partition): + """Sets the partition of this V1AWSElasticBlockStoreVolumeSource. + + partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). # noqa: E501 + + :param partition: The partition of this V1AWSElasticBlockStoreVolumeSource. # noqa: E501 + :type partition: int + """ + + self._partition = partition + + @property + def read_only(self): + """Gets the read_only of this V1AWSElasticBlockStoreVolumeSource. # noqa: E501 + + readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore # noqa: E501 + + :return: The read_only of this V1AWSElasticBlockStoreVolumeSource. # noqa: E501 + :rtype: bool + """ + return self._read_only + + @read_only.setter + def read_only(self, read_only): + """Sets the read_only of this V1AWSElasticBlockStoreVolumeSource. + + readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore # noqa: E501 + + :param read_only: The read_only of this V1AWSElasticBlockStoreVolumeSource. # noqa: E501 + :type read_only: bool + """ + + self._read_only = read_only + + @property + def volume_id(self): + """Gets the volume_id of this V1AWSElasticBlockStoreVolumeSource. # noqa: E501 + + volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore # noqa: E501 + + :return: The volume_id of this V1AWSElasticBlockStoreVolumeSource. # noqa: E501 + :rtype: str + """ + return self._volume_id + + @volume_id.setter + def volume_id(self, volume_id): + """Sets the volume_id of this V1AWSElasticBlockStoreVolumeSource. + + volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore # noqa: E501 + + :param volume_id: The volume_id of this V1AWSElasticBlockStoreVolumeSource. # noqa: E501 + :type volume_id: str + """ + if self.local_vars_configuration.client_side_validation and volume_id is None: # noqa: E501 + raise ValueError("Invalid value for `volume_id`, must not be `None`") # noqa: E501 + + self._volume_id = volume_id + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1AWSElasticBlockStoreVolumeSource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1AWSElasticBlockStoreVolumeSource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_azure_disk_volume_source.py b/kubernetes_asyncio/client/models/v1_azure_disk_volume_source.py new file mode 100644 index 0000000000..62be2b2778 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_azure_disk_volume_source.py @@ -0,0 +1,275 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1AzureDiskVolumeSource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'caching_mode': 'str', + 'disk_name': 'str', + 'disk_uri': 'str', + 'fs_type': 'str', + 'kind': 'str', + 'read_only': 'bool' + } + + attribute_map = { + 'caching_mode': 'cachingMode', + 'disk_name': 'diskName', + 'disk_uri': 'diskURI', + 'fs_type': 'fsType', + 'kind': 'kind', + 'read_only': 'readOnly' + } + + def __init__(self, caching_mode=None, disk_name=None, disk_uri=None, fs_type=None, kind=None, read_only=None, local_vars_configuration=None): # noqa: E501 + """V1AzureDiskVolumeSource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._caching_mode = None + self._disk_name = None + self._disk_uri = None + self._fs_type = None + self._kind = None + self._read_only = None + self.discriminator = None + + if caching_mode is not None: + self.caching_mode = caching_mode + self.disk_name = disk_name + self.disk_uri = disk_uri + if fs_type is not None: + self.fs_type = fs_type + if kind is not None: + self.kind = kind + if read_only is not None: + self.read_only = read_only + + @property + def caching_mode(self): + """Gets the caching_mode of this V1AzureDiskVolumeSource. # noqa: E501 + + cachingMode is the Host Caching mode: None, Read Only, Read Write. # noqa: E501 + + :return: The caching_mode of this V1AzureDiskVolumeSource. # noqa: E501 + :rtype: str + """ + return self._caching_mode + + @caching_mode.setter + def caching_mode(self, caching_mode): + """Sets the caching_mode of this V1AzureDiskVolumeSource. + + cachingMode is the Host Caching mode: None, Read Only, Read Write. # noqa: E501 + + :param caching_mode: The caching_mode of this V1AzureDiskVolumeSource. # noqa: E501 + :type caching_mode: str + """ + + self._caching_mode = caching_mode + + @property + def disk_name(self): + """Gets the disk_name of this V1AzureDiskVolumeSource. # noqa: E501 + + diskName is the Name of the data disk in the blob storage # noqa: E501 + + :return: The disk_name of this V1AzureDiskVolumeSource. # noqa: E501 + :rtype: str + """ + return self._disk_name + + @disk_name.setter + def disk_name(self, disk_name): + """Sets the disk_name of this V1AzureDiskVolumeSource. + + diskName is the Name of the data disk in the blob storage # noqa: E501 + + :param disk_name: The disk_name of this V1AzureDiskVolumeSource. # noqa: E501 + :type disk_name: str + """ + if self.local_vars_configuration.client_side_validation and disk_name is None: # noqa: E501 + raise ValueError("Invalid value for `disk_name`, must not be `None`") # noqa: E501 + + self._disk_name = disk_name + + @property + def disk_uri(self): + """Gets the disk_uri of this V1AzureDiskVolumeSource. # noqa: E501 + + diskURI is the URI of data disk in the blob storage # noqa: E501 + + :return: The disk_uri of this V1AzureDiskVolumeSource. # noqa: E501 + :rtype: str + """ + return self._disk_uri + + @disk_uri.setter + def disk_uri(self, disk_uri): + """Sets the disk_uri of this V1AzureDiskVolumeSource. + + diskURI is the URI of data disk in the blob storage # noqa: E501 + + :param disk_uri: The disk_uri of this V1AzureDiskVolumeSource. # noqa: E501 + :type disk_uri: str + """ + if self.local_vars_configuration.client_side_validation and disk_uri is None: # noqa: E501 + raise ValueError("Invalid value for `disk_uri`, must not be `None`") # noqa: E501 + + self._disk_uri = disk_uri + + @property + def fs_type(self): + """Gets the fs_type of this V1AzureDiskVolumeSource. # noqa: E501 + + fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. # noqa: E501 + + :return: The fs_type of this V1AzureDiskVolumeSource. # noqa: E501 + :rtype: str + """ + return self._fs_type + + @fs_type.setter + def fs_type(self, fs_type): + """Sets the fs_type of this V1AzureDiskVolumeSource. + + fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. # noqa: E501 + + :param fs_type: The fs_type of this V1AzureDiskVolumeSource. # noqa: E501 + :type fs_type: str + """ + + self._fs_type = fs_type + + @property + def kind(self): + """Gets the kind of this V1AzureDiskVolumeSource. # noqa: E501 + + kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared # noqa: E501 + + :return: The kind of this V1AzureDiskVolumeSource. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1AzureDiskVolumeSource. + + kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared # noqa: E501 + + :param kind: The kind of this V1AzureDiskVolumeSource. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def read_only(self): + """Gets the read_only of this V1AzureDiskVolumeSource. # noqa: E501 + + readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. # noqa: E501 + + :return: The read_only of this V1AzureDiskVolumeSource. # noqa: E501 + :rtype: bool + """ + return self._read_only + + @read_only.setter + def read_only(self, read_only): + """Sets the read_only of this V1AzureDiskVolumeSource. + + readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. # noqa: E501 + + :param read_only: The read_only of this V1AzureDiskVolumeSource. # noqa: E501 + :type read_only: bool + """ + + self._read_only = read_only + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1AzureDiskVolumeSource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1AzureDiskVolumeSource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_azure_file_persistent_volume_source.py b/kubernetes_asyncio/client/models/v1_azure_file_persistent_volume_source.py new file mode 100644 index 0000000000..228237b7b3 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_azure_file_persistent_volume_source.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1AzureFilePersistentVolumeSource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'read_only': 'bool', + 'secret_name': 'str', + 'secret_namespace': 'str', + 'share_name': 'str' + } + + attribute_map = { + 'read_only': 'readOnly', + 'secret_name': 'secretName', + 'secret_namespace': 'secretNamespace', + 'share_name': 'shareName' + } + + def __init__(self, read_only=None, secret_name=None, secret_namespace=None, share_name=None, local_vars_configuration=None): # noqa: E501 + """V1AzureFilePersistentVolumeSource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._read_only = None + self._secret_name = None + self._secret_namespace = None + self._share_name = None + self.discriminator = None + + if read_only is not None: + self.read_only = read_only + self.secret_name = secret_name + if secret_namespace is not None: + self.secret_namespace = secret_namespace + self.share_name = share_name + + @property + def read_only(self): + """Gets the read_only of this V1AzureFilePersistentVolumeSource. # noqa: E501 + + readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. # noqa: E501 + + :return: The read_only of this V1AzureFilePersistentVolumeSource. # noqa: E501 + :rtype: bool + """ + return self._read_only + + @read_only.setter + def read_only(self, read_only): + """Sets the read_only of this V1AzureFilePersistentVolumeSource. + + readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. # noqa: E501 + + :param read_only: The read_only of this V1AzureFilePersistentVolumeSource. # noqa: E501 + :type read_only: bool + """ + + self._read_only = read_only + + @property + def secret_name(self): + """Gets the secret_name of this V1AzureFilePersistentVolumeSource. # noqa: E501 + + secretName is the name of secret that contains Azure Storage Account Name and Key # noqa: E501 + + :return: The secret_name of this V1AzureFilePersistentVolumeSource. # noqa: E501 + :rtype: str + """ + return self._secret_name + + @secret_name.setter + def secret_name(self, secret_name): + """Sets the secret_name of this V1AzureFilePersistentVolumeSource. + + secretName is the name of secret that contains Azure Storage Account Name and Key # noqa: E501 + + :param secret_name: The secret_name of this V1AzureFilePersistentVolumeSource. # noqa: E501 + :type secret_name: str + """ + if self.local_vars_configuration.client_side_validation and secret_name is None: # noqa: E501 + raise ValueError("Invalid value for `secret_name`, must not be `None`") # noqa: E501 + + self._secret_name = secret_name + + @property + def secret_namespace(self): + """Gets the secret_namespace of this V1AzureFilePersistentVolumeSource. # noqa: E501 + + secretNamespace is the namespace of the secret that contains Azure Storage Account Name and Key default is the same as the Pod # noqa: E501 + + :return: The secret_namespace of this V1AzureFilePersistentVolumeSource. # noqa: E501 + :rtype: str + """ + return self._secret_namespace + + @secret_namespace.setter + def secret_namespace(self, secret_namespace): + """Sets the secret_namespace of this V1AzureFilePersistentVolumeSource. + + secretNamespace is the namespace of the secret that contains Azure Storage Account Name and Key default is the same as the Pod # noqa: E501 + + :param secret_namespace: The secret_namespace of this V1AzureFilePersistentVolumeSource. # noqa: E501 + :type secret_namespace: str + """ + + self._secret_namespace = secret_namespace + + @property + def share_name(self): + """Gets the share_name of this V1AzureFilePersistentVolumeSource. # noqa: E501 + + shareName is the azure Share Name # noqa: E501 + + :return: The share_name of this V1AzureFilePersistentVolumeSource. # noqa: E501 + :rtype: str + """ + return self._share_name + + @share_name.setter + def share_name(self, share_name): + """Sets the share_name of this V1AzureFilePersistentVolumeSource. + + shareName is the azure Share Name # noqa: E501 + + :param share_name: The share_name of this V1AzureFilePersistentVolumeSource. # noqa: E501 + :type share_name: str + """ + if self.local_vars_configuration.client_side_validation and share_name is None: # noqa: E501 + raise ValueError("Invalid value for `share_name`, must not be `None`") # noqa: E501 + + self._share_name = share_name + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1AzureFilePersistentVolumeSource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1AzureFilePersistentVolumeSource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_azure_file_volume_source.py b/kubernetes_asyncio/client/models/v1_azure_file_volume_source.py new file mode 100644 index 0000000000..06403a7716 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_azure_file_volume_source.py @@ -0,0 +1,191 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1AzureFileVolumeSource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'read_only': 'bool', + 'secret_name': 'str', + 'share_name': 'str' + } + + attribute_map = { + 'read_only': 'readOnly', + 'secret_name': 'secretName', + 'share_name': 'shareName' + } + + def __init__(self, read_only=None, secret_name=None, share_name=None, local_vars_configuration=None): # noqa: E501 + """V1AzureFileVolumeSource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._read_only = None + self._secret_name = None + self._share_name = None + self.discriminator = None + + if read_only is not None: + self.read_only = read_only + self.secret_name = secret_name + self.share_name = share_name + + @property + def read_only(self): + """Gets the read_only of this V1AzureFileVolumeSource. # noqa: E501 + + readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. # noqa: E501 + + :return: The read_only of this V1AzureFileVolumeSource. # noqa: E501 + :rtype: bool + """ + return self._read_only + + @read_only.setter + def read_only(self, read_only): + """Sets the read_only of this V1AzureFileVolumeSource. + + readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. # noqa: E501 + + :param read_only: The read_only of this V1AzureFileVolumeSource. # noqa: E501 + :type read_only: bool + """ + + self._read_only = read_only + + @property + def secret_name(self): + """Gets the secret_name of this V1AzureFileVolumeSource. # noqa: E501 + + secretName is the name of secret that contains Azure Storage Account Name and Key # noqa: E501 + + :return: The secret_name of this V1AzureFileVolumeSource. # noqa: E501 + :rtype: str + """ + return self._secret_name + + @secret_name.setter + def secret_name(self, secret_name): + """Sets the secret_name of this V1AzureFileVolumeSource. + + secretName is the name of secret that contains Azure Storage Account Name and Key # noqa: E501 + + :param secret_name: The secret_name of this V1AzureFileVolumeSource. # noqa: E501 + :type secret_name: str + """ + if self.local_vars_configuration.client_side_validation and secret_name is None: # noqa: E501 + raise ValueError("Invalid value for `secret_name`, must not be `None`") # noqa: E501 + + self._secret_name = secret_name + + @property + def share_name(self): + """Gets the share_name of this V1AzureFileVolumeSource. # noqa: E501 + + shareName is the azure share Name # noqa: E501 + + :return: The share_name of this V1AzureFileVolumeSource. # noqa: E501 + :rtype: str + """ + return self._share_name + + @share_name.setter + def share_name(self, share_name): + """Sets the share_name of this V1AzureFileVolumeSource. + + shareName is the azure share Name # noqa: E501 + + :param share_name: The share_name of this V1AzureFileVolumeSource. # noqa: E501 + :type share_name: str + """ + if self.local_vars_configuration.client_side_validation and share_name is None: # noqa: E501 + raise ValueError("Invalid value for `share_name`, must not be `None`") # noqa: E501 + + self._share_name = share_name + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1AzureFileVolumeSource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1AzureFileVolumeSource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_binding.py b/kubernetes_asyncio/client/models/v1_binding.py new file mode 100644 index 0000000000..d07bd17af5 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_binding.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1Binding(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'target': 'V1ObjectReference' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'target': 'target' + } + + def __init__(self, api_version=None, kind=None, metadata=None, target=None, local_vars_configuration=None): # noqa: E501 + """V1Binding - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._metadata = None + self._target = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + self.target = target + + @property + def api_version(self): + """Gets the api_version of this V1Binding. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1Binding. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1Binding. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1Binding. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1Binding. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1Binding. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1Binding. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1Binding. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1Binding. # noqa: E501 + + + :return: The metadata of this V1Binding. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1Binding. + + + :param metadata: The metadata of this V1Binding. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def target(self): + """Gets the target of this V1Binding. # noqa: E501 + + + :return: The target of this V1Binding. # noqa: E501 + :rtype: V1ObjectReference + """ + return self._target + + @target.setter + def target(self, target): + """Sets the target of this V1Binding. + + + :param target: The target of this V1Binding. # noqa: E501 + :type target: V1ObjectReference + """ + if self.local_vars_configuration.client_side_validation and target is None: # noqa: E501 + raise ValueError("Invalid value for `target`, must not be `None`") # noqa: E501 + + self._target = target + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1Binding): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1Binding): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_bound_object_reference.py b/kubernetes_asyncio/client/models/v1_bound_object_reference.py new file mode 100644 index 0000000000..227da7d644 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_bound_object_reference.py @@ -0,0 +1,217 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1BoundObjectReference(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'name': 'str', + 'uid': 'str' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'name': 'name', + 'uid': 'uid' + } + + def __init__(self, api_version=None, kind=None, name=None, uid=None, local_vars_configuration=None): # noqa: E501 + """V1BoundObjectReference - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._name = None + self._uid = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if name is not None: + self.name = name + if uid is not None: + self.uid = uid + + @property + def api_version(self): + """Gets the api_version of this V1BoundObjectReference. # noqa: E501 + + API version of the referent. # noqa: E501 + + :return: The api_version of this V1BoundObjectReference. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1BoundObjectReference. + + API version of the referent. # noqa: E501 + + :param api_version: The api_version of this V1BoundObjectReference. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1BoundObjectReference. # noqa: E501 + + Kind of the referent. Valid kinds are 'Pod' and 'Secret'. # noqa: E501 + + :return: The kind of this V1BoundObjectReference. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1BoundObjectReference. + + Kind of the referent. Valid kinds are 'Pod' and 'Secret'. # noqa: E501 + + :param kind: The kind of this V1BoundObjectReference. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def name(self): + """Gets the name of this V1BoundObjectReference. # noqa: E501 + + Name of the referent. # noqa: E501 + + :return: The name of this V1BoundObjectReference. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1BoundObjectReference. + + Name of the referent. # noqa: E501 + + :param name: The name of this V1BoundObjectReference. # noqa: E501 + :type name: str + """ + + self._name = name + + @property + def uid(self): + """Gets the uid of this V1BoundObjectReference. # noqa: E501 + + UID of the referent. # noqa: E501 + + :return: The uid of this V1BoundObjectReference. # noqa: E501 + :rtype: str + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this V1BoundObjectReference. + + UID of the referent. # noqa: E501 + + :param uid: The uid of this V1BoundObjectReference. # noqa: E501 + :type uid: str + """ + + self._uid = uid + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1BoundObjectReference): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1BoundObjectReference): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_capabilities.py b/kubernetes_asyncio/client/models/v1_capabilities.py new file mode 100644 index 0000000000..5d1534c862 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_capabilities.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1Capabilities(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'add': 'list[str]', + 'drop': 'list[str]' + } + + attribute_map = { + 'add': 'add', + 'drop': 'drop' + } + + def __init__(self, add=None, drop=None, local_vars_configuration=None): # noqa: E501 + """V1Capabilities - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._add = None + self._drop = None + self.discriminator = None + + if add is not None: + self.add = add + if drop is not None: + self.drop = drop + + @property + def add(self): + """Gets the add of this V1Capabilities. # noqa: E501 + + Added capabilities # noqa: E501 + + :return: The add of this V1Capabilities. # noqa: E501 + :rtype: list[str] + """ + return self._add + + @add.setter + def add(self, add): + """Sets the add of this V1Capabilities. + + Added capabilities # noqa: E501 + + :param add: The add of this V1Capabilities. # noqa: E501 + :type add: list[str] + """ + + self._add = add + + @property + def drop(self): + """Gets the drop of this V1Capabilities. # noqa: E501 + + Removed capabilities # noqa: E501 + + :return: The drop of this V1Capabilities. # noqa: E501 + :rtype: list[str] + """ + return self._drop + + @drop.setter + def drop(self, drop): + """Sets the drop of this V1Capabilities. + + Removed capabilities # noqa: E501 + + :param drop: The drop of this V1Capabilities. # noqa: E501 + :type drop: list[str] + """ + + self._drop = drop + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1Capabilities): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1Capabilities): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_capacity_request_policy.py b/kubernetes_asyncio/client/models/v1_capacity_request_policy.py new file mode 100644 index 0000000000..5d692869b2 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_capacity_request_policy.py @@ -0,0 +1,187 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CapacityRequestPolicy(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'default': 'str', + 'valid_range': 'V1CapacityRequestPolicyRange', + 'valid_values': 'list[str]' + } + + attribute_map = { + 'default': 'default', + 'valid_range': 'validRange', + 'valid_values': 'validValues' + } + + def __init__(self, default=None, valid_range=None, valid_values=None, local_vars_configuration=None): # noqa: E501 + """V1CapacityRequestPolicy - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._default = None + self._valid_range = None + self._valid_values = None + self.discriminator = None + + if default is not None: + self.default = default + if valid_range is not None: + self.valid_range = valid_range + if valid_values is not None: + self.valid_values = valid_values + + @property + def default(self): + """Gets the default of this V1CapacityRequestPolicy. # noqa: E501 + + Default specifies how much of this capacity is consumed by a request that does not contain an entry for it in DeviceRequest's Capacity. # noqa: E501 + + :return: The default of this V1CapacityRequestPolicy. # noqa: E501 + :rtype: str + """ + return self._default + + @default.setter + def default(self, default): + """Sets the default of this V1CapacityRequestPolicy. + + Default specifies how much of this capacity is consumed by a request that does not contain an entry for it in DeviceRequest's Capacity. # noqa: E501 + + :param default: The default of this V1CapacityRequestPolicy. # noqa: E501 + :type default: str + """ + + self._default = default + + @property + def valid_range(self): + """Gets the valid_range of this V1CapacityRequestPolicy. # noqa: E501 + + + :return: The valid_range of this V1CapacityRequestPolicy. # noqa: E501 + :rtype: V1CapacityRequestPolicyRange + """ + return self._valid_range + + @valid_range.setter + def valid_range(self, valid_range): + """Sets the valid_range of this V1CapacityRequestPolicy. + + + :param valid_range: The valid_range of this V1CapacityRequestPolicy. # noqa: E501 + :type valid_range: V1CapacityRequestPolicyRange + """ + + self._valid_range = valid_range + + @property + def valid_values(self): + """Gets the valid_values of this V1CapacityRequestPolicy. # noqa: E501 + + ValidValues defines a set of acceptable quantity values in consuming requests. Must not contain more than 10 entries. Must be sorted in ascending order. If this field is set, Default must be defined and it must be included in ValidValues list. If the requested amount does not match any valid value but smaller than some valid values, the scheduler calculates the smallest valid value that is greater than or equal to the request. That is: min(ceil(requestedValue) ∈ validValues), where requestedValue ≤ max(validValues). If the requested amount exceeds all valid values, the request violates the policy, and this device cannot be allocated. # noqa: E501 + + :return: The valid_values of this V1CapacityRequestPolicy. # noqa: E501 + :rtype: list[str] + """ + return self._valid_values + + @valid_values.setter + def valid_values(self, valid_values): + """Sets the valid_values of this V1CapacityRequestPolicy. + + ValidValues defines a set of acceptable quantity values in consuming requests. Must not contain more than 10 entries. Must be sorted in ascending order. If this field is set, Default must be defined and it must be included in ValidValues list. If the requested amount does not match any valid value but smaller than some valid values, the scheduler calculates the smallest valid value that is greater than or equal to the request. That is: min(ceil(requestedValue) ∈ validValues), where requestedValue ≤ max(validValues). If the requested amount exceeds all valid values, the request violates the policy, and this device cannot be allocated. # noqa: E501 + + :param valid_values: The valid_values of this V1CapacityRequestPolicy. # noqa: E501 + :type valid_values: list[str] + """ + + self._valid_values = valid_values + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CapacityRequestPolicy): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CapacityRequestPolicy): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_capacity_request_policy_range.py b/kubernetes_asyncio/client/models/v1_capacity_request_policy_range.py new file mode 100644 index 0000000000..6332ee339b --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_capacity_request_policy_range.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CapacityRequestPolicyRange(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'max': 'str', + 'min': 'str', + 'step': 'str' + } + + attribute_map = { + 'max': 'max', + 'min': 'min', + 'step': 'step' + } + + def __init__(self, max=None, min=None, step=None, local_vars_configuration=None): # noqa: E501 + """V1CapacityRequestPolicyRange - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._max = None + self._min = None + self._step = None + self.discriminator = None + + if max is not None: + self.max = max + self.min = min + if step is not None: + self.step = step + + @property + def max(self): + """Gets the max of this V1CapacityRequestPolicyRange. # noqa: E501 + + Max defines the upper limit for capacity that can be requested. Max must be less than or equal to the capacity value. Min and requestPolicy.default must be less than or equal to the maximum. # noqa: E501 + + :return: The max of this V1CapacityRequestPolicyRange. # noqa: E501 + :rtype: str + """ + return self._max + + @max.setter + def max(self, max): + """Sets the max of this V1CapacityRequestPolicyRange. + + Max defines the upper limit for capacity that can be requested. Max must be less than or equal to the capacity value. Min and requestPolicy.default must be less than or equal to the maximum. # noqa: E501 + + :param max: The max of this V1CapacityRequestPolicyRange. # noqa: E501 + :type max: str + """ + + self._max = max + + @property + def min(self): + """Gets the min of this V1CapacityRequestPolicyRange. # noqa: E501 + + Min specifies the minimum capacity allowed for a consumption request. Min must be greater than or equal to zero, and less than or equal to the capacity value. requestPolicy.default must be more than or equal to the minimum. # noqa: E501 + + :return: The min of this V1CapacityRequestPolicyRange. # noqa: E501 + :rtype: str + """ + return self._min + + @min.setter + def min(self, min): + """Sets the min of this V1CapacityRequestPolicyRange. + + Min specifies the minimum capacity allowed for a consumption request. Min must be greater than or equal to zero, and less than or equal to the capacity value. requestPolicy.default must be more than or equal to the minimum. # noqa: E501 + + :param min: The min of this V1CapacityRequestPolicyRange. # noqa: E501 + :type min: str + """ + if self.local_vars_configuration.client_side_validation and min is None: # noqa: E501 + raise ValueError("Invalid value for `min`, must not be `None`") # noqa: E501 + + self._min = min + + @property + def step(self): + """Gets the step of this V1CapacityRequestPolicyRange. # noqa: E501 + + Step defines the step size between valid capacity amounts within the range. Max (if set) and requestPolicy.default must be a multiple of Step. Min + Step must be less than or equal to the capacity value. # noqa: E501 + + :return: The step of this V1CapacityRequestPolicyRange. # noqa: E501 + :rtype: str + """ + return self._step + + @step.setter + def step(self, step): + """Sets the step of this V1CapacityRequestPolicyRange. + + Step defines the step size between valid capacity amounts within the range. Max (if set) and requestPolicy.default must be a multiple of Step. Min + Step must be less than or equal to the capacity value. # noqa: E501 + + :param step: The step of this V1CapacityRequestPolicyRange. # noqa: E501 + :type step: str + """ + + self._step = step + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CapacityRequestPolicyRange): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CapacityRequestPolicyRange): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_capacity_requirements.py b/kubernetes_asyncio/client/models/v1_capacity_requirements.py new file mode 100644 index 0000000000..b47bfae7d9 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_capacity_requirements.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CapacityRequirements(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'requests': 'dict[str, str]' + } + + attribute_map = { + 'requests': 'requests' + } + + def __init__(self, requests=None, local_vars_configuration=None): # noqa: E501 + """V1CapacityRequirements - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._requests = None + self.discriminator = None + + if requests is not None: + self.requests = requests + + @property + def requests(self): + """Gets the requests of this V1CapacityRequirements. # noqa: E501 + + Requests represent individual device resource requests for distinct resources, all of which must be provided by the device. This value is used as an additional filtering condition against the available capacity on the device. This is semantically equivalent to a CEL selector with `device.capacity[]..compareTo(quantity()) >= 0`. For example, device.capacity['test-driver.cdi.k8s.io'].counters.compareTo(quantity('2')) >= 0. When a requestPolicy is defined, the requested amount is adjusted upward to the nearest valid value based on the policy. If the requested amount cannot be adjusted to a valid value—because it exceeds what the requestPolicy allows— the device is considered ineligible for allocation. For any capacity that is not explicitly requested: - If no requestPolicy is set, the default consumed capacity is equal to the full device capacity (i.e., the whole device is claimed). - If a requestPolicy is set, the default consumed capacity is determined according to that policy. If the device allows multiple allocation, the aggregated amount across all requests must not exceed the capacity value. The consumed capacity, which may be adjusted based on the requestPolicy if defined, is recorded in the resource claim’s status.devices[*].consumedCapacity field. # noqa: E501 + + :return: The requests of this V1CapacityRequirements. # noqa: E501 + :rtype: dict[str, str] + """ + return self._requests + + @requests.setter + def requests(self, requests): + """Sets the requests of this V1CapacityRequirements. + + Requests represent individual device resource requests for distinct resources, all of which must be provided by the device. This value is used as an additional filtering condition against the available capacity on the device. This is semantically equivalent to a CEL selector with `device.capacity[]..compareTo(quantity()) >= 0`. For example, device.capacity['test-driver.cdi.k8s.io'].counters.compareTo(quantity('2')) >= 0. When a requestPolicy is defined, the requested amount is adjusted upward to the nearest valid value based on the policy. If the requested amount cannot be adjusted to a valid value—because it exceeds what the requestPolicy allows— the device is considered ineligible for allocation. For any capacity that is not explicitly requested: - If no requestPolicy is set, the default consumed capacity is equal to the full device capacity (i.e., the whole device is claimed). - If a requestPolicy is set, the default consumed capacity is determined according to that policy. If the device allows multiple allocation, the aggregated amount across all requests must not exceed the capacity value. The consumed capacity, which may be adjusted based on the requestPolicy if defined, is recorded in the resource claim’s status.devices[*].consumedCapacity field. # noqa: E501 + + :param requests: The requests of this V1CapacityRequirements. # noqa: E501 + :type requests: dict[str, str] + """ + + self._requests = requests + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CapacityRequirements): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CapacityRequirements): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_cel_device_selector.py b/kubernetes_asyncio/client/models/v1_cel_device_selector.py new file mode 100644 index 0000000000..d460364c33 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_cel_device_selector.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CELDeviceSelector(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'expression': 'str' + } + + attribute_map = { + 'expression': 'expression' + } + + def __init__(self, expression=None, local_vars_configuration=None): # noqa: E501 + """V1CELDeviceSelector - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._expression = None + self.discriminator = None + + self.expression = expression + + @property + def expression(self): + """Gets the expression of this V1CELDeviceSelector. # noqa: E501 + + Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort. The expression's input is an object named \"device\", which carries the following properties: - driver (string): the name of the driver which defines this device. - attributes (map[string]object): the device's attributes, grouped by prefix (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all of the attributes which were prefixed by \"dra.example.com\". - capacity (map[string]object): the device's capacities, grouped by prefix. - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device (v1.34+ with the DRAConsumableCapacity feature enabled). Example: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields: device.driver device.attributes[\"dra.example.com\"].model device.attributes[\"ext.example.com\"].family device.capacity[\"dra.example.com\"].modules The device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers. The value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity. If an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort. A robust expression should check for the existence of attributes before referencing them. For ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example: cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool) The length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps. # noqa: E501 + + :return: The expression of this V1CELDeviceSelector. # noqa: E501 + :rtype: str + """ + return self._expression + + @expression.setter + def expression(self, expression): + """Sets the expression of this V1CELDeviceSelector. + + Expression is a CEL expression which evaluates a single device. It must evaluate to true when the device under consideration satisfies the desired criteria, and false when it does not. Any other result is an error and causes allocation of devices to abort. The expression's input is an object named \"device\", which carries the following properties: - driver (string): the name of the driver which defines this device. - attributes (map[string]object): the device's attributes, grouped by prefix (e.g. device.attributes[\"dra.example.com\"] evaluates to an object with all of the attributes which were prefixed by \"dra.example.com\". - capacity (map[string]object): the device's capacities, grouped by prefix. - allowMultipleAllocations (bool): the allowMultipleAllocations property of the device (v1.34+ with the DRAConsumableCapacity feature enabled). Example: Consider a device with driver=\"dra.example.com\", which exposes two attributes named \"model\" and \"ext.example.com/family\" and which exposes one capacity named \"modules\". This input to this expression would have the following fields: device.driver device.attributes[\"dra.example.com\"].model device.attributes[\"ext.example.com\"].family device.capacity[\"dra.example.com\"].modules The device.driver field can be used to check for a specific driver, either as a high-level precondition (i.e. you only want to consider devices from this driver) or as part of a multi-clause expression that is meant to consider devices from different drivers. The value type of each attribute is defined by the device definition, and users who write these expressions must consult the documentation for their specific drivers. The value type of each capacity is Quantity. If an unknown prefix is used as a lookup in either device.attributes or device.capacity, an empty map will be returned. Any reference to an unknown field will cause an evaluation error and allocation to abort. A robust expression should check for the existence of attributes before referencing them. For ease of use, the cel.bind() function is enabled, and can be used to simplify expressions that access multiple attributes with the same domain. For example: cel.bind(dra, device.attributes[\"dra.example.com\"], dra.someBool && dra.anotherBool) The length of the expression must be smaller or equal to 10 Ki. The cost of evaluating it is also limited based on the estimated number of logical steps. # noqa: E501 + + :param expression: The expression of this V1CELDeviceSelector. # noqa: E501 + :type expression: str + """ + if self.local_vars_configuration.client_side_validation and expression is None: # noqa: E501 + raise ValueError("Invalid value for `expression`, must not be `None`") # noqa: E501 + + self._expression = expression + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CELDeviceSelector): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CELDeviceSelector): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_ceph_fs_persistent_volume_source.py b/kubernetes_asyncio/client/models/v1_ceph_fs_persistent_volume_source.py new file mode 100644 index 0000000000..2756984626 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_ceph_fs_persistent_volume_source.py @@ -0,0 +1,272 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CephFSPersistentVolumeSource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'monitors': 'list[str]', + 'path': 'str', + 'read_only': 'bool', + 'secret_file': 'str', + 'secret_ref': 'V1SecretReference', + 'user': 'str' + } + + attribute_map = { + 'monitors': 'monitors', + 'path': 'path', + 'read_only': 'readOnly', + 'secret_file': 'secretFile', + 'secret_ref': 'secretRef', + 'user': 'user' + } + + def __init__(self, monitors=None, path=None, read_only=None, secret_file=None, secret_ref=None, user=None, local_vars_configuration=None): # noqa: E501 + """V1CephFSPersistentVolumeSource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._monitors = None + self._path = None + self._read_only = None + self._secret_file = None + self._secret_ref = None + self._user = None + self.discriminator = None + + self.monitors = monitors + if path is not None: + self.path = path + if read_only is not None: + self.read_only = read_only + if secret_file is not None: + self.secret_file = secret_file + if secret_ref is not None: + self.secret_ref = secret_ref + if user is not None: + self.user = user + + @property + def monitors(self): + """Gets the monitors of this V1CephFSPersistentVolumeSource. # noqa: E501 + + monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :return: The monitors of this V1CephFSPersistentVolumeSource. # noqa: E501 + :rtype: list[str] + """ + return self._monitors + + @monitors.setter + def monitors(self, monitors): + """Sets the monitors of this V1CephFSPersistentVolumeSource. + + monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :param monitors: The monitors of this V1CephFSPersistentVolumeSource. # noqa: E501 + :type monitors: list[str] + """ + if self.local_vars_configuration.client_side_validation and monitors is None: # noqa: E501 + raise ValueError("Invalid value for `monitors`, must not be `None`") # noqa: E501 + + self._monitors = monitors + + @property + def path(self): + """Gets the path of this V1CephFSPersistentVolumeSource. # noqa: E501 + + path is Optional: Used as the mounted root, rather than the full Ceph tree, default is / # noqa: E501 + + :return: The path of this V1CephFSPersistentVolumeSource. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this V1CephFSPersistentVolumeSource. + + path is Optional: Used as the mounted root, rather than the full Ceph tree, default is / # noqa: E501 + + :param path: The path of this V1CephFSPersistentVolumeSource. # noqa: E501 + :type path: str + """ + + self._path = path + + @property + def read_only(self): + """Gets the read_only of this V1CephFSPersistentVolumeSource. # noqa: E501 + + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :return: The read_only of this V1CephFSPersistentVolumeSource. # noqa: E501 + :rtype: bool + """ + return self._read_only + + @read_only.setter + def read_only(self, read_only): + """Sets the read_only of this V1CephFSPersistentVolumeSource. + + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :param read_only: The read_only of this V1CephFSPersistentVolumeSource. # noqa: E501 + :type read_only: bool + """ + + self._read_only = read_only + + @property + def secret_file(self): + """Gets the secret_file of this V1CephFSPersistentVolumeSource. # noqa: E501 + + secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :return: The secret_file of this V1CephFSPersistentVolumeSource. # noqa: E501 + :rtype: str + """ + return self._secret_file + + @secret_file.setter + def secret_file(self, secret_file): + """Sets the secret_file of this V1CephFSPersistentVolumeSource. + + secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :param secret_file: The secret_file of this V1CephFSPersistentVolumeSource. # noqa: E501 + :type secret_file: str + """ + + self._secret_file = secret_file + + @property + def secret_ref(self): + """Gets the secret_ref of this V1CephFSPersistentVolumeSource. # noqa: E501 + + + :return: The secret_ref of this V1CephFSPersistentVolumeSource. # noqa: E501 + :rtype: V1SecretReference + """ + return self._secret_ref + + @secret_ref.setter + def secret_ref(self, secret_ref): + """Sets the secret_ref of this V1CephFSPersistentVolumeSource. + + + :param secret_ref: The secret_ref of this V1CephFSPersistentVolumeSource. # noqa: E501 + :type secret_ref: V1SecretReference + """ + + self._secret_ref = secret_ref + + @property + def user(self): + """Gets the user of this V1CephFSPersistentVolumeSource. # noqa: E501 + + user is Optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :return: The user of this V1CephFSPersistentVolumeSource. # noqa: E501 + :rtype: str + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this V1CephFSPersistentVolumeSource. + + user is Optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :param user: The user of this V1CephFSPersistentVolumeSource. # noqa: E501 + :type user: str + """ + + self._user = user + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CephFSPersistentVolumeSource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CephFSPersistentVolumeSource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_ceph_fs_volume_source.py b/kubernetes_asyncio/client/models/v1_ceph_fs_volume_source.py new file mode 100644 index 0000000000..74f6728d7e --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_ceph_fs_volume_source.py @@ -0,0 +1,272 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CephFSVolumeSource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'monitors': 'list[str]', + 'path': 'str', + 'read_only': 'bool', + 'secret_file': 'str', + 'secret_ref': 'V1LocalObjectReference', + 'user': 'str' + } + + attribute_map = { + 'monitors': 'monitors', + 'path': 'path', + 'read_only': 'readOnly', + 'secret_file': 'secretFile', + 'secret_ref': 'secretRef', + 'user': 'user' + } + + def __init__(self, monitors=None, path=None, read_only=None, secret_file=None, secret_ref=None, user=None, local_vars_configuration=None): # noqa: E501 + """V1CephFSVolumeSource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._monitors = None + self._path = None + self._read_only = None + self._secret_file = None + self._secret_ref = None + self._user = None + self.discriminator = None + + self.monitors = monitors + if path is not None: + self.path = path + if read_only is not None: + self.read_only = read_only + if secret_file is not None: + self.secret_file = secret_file + if secret_ref is not None: + self.secret_ref = secret_ref + if user is not None: + self.user = user + + @property + def monitors(self): + """Gets the monitors of this V1CephFSVolumeSource. # noqa: E501 + + monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :return: The monitors of this V1CephFSVolumeSource. # noqa: E501 + :rtype: list[str] + """ + return self._monitors + + @monitors.setter + def monitors(self, monitors): + """Sets the monitors of this V1CephFSVolumeSource. + + monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :param monitors: The monitors of this V1CephFSVolumeSource. # noqa: E501 + :type monitors: list[str] + """ + if self.local_vars_configuration.client_side_validation and monitors is None: # noqa: E501 + raise ValueError("Invalid value for `monitors`, must not be `None`") # noqa: E501 + + self._monitors = monitors + + @property + def path(self): + """Gets the path of this V1CephFSVolumeSource. # noqa: E501 + + path is Optional: Used as the mounted root, rather than the full Ceph tree, default is / # noqa: E501 + + :return: The path of this V1CephFSVolumeSource. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this V1CephFSVolumeSource. + + path is Optional: Used as the mounted root, rather than the full Ceph tree, default is / # noqa: E501 + + :param path: The path of this V1CephFSVolumeSource. # noqa: E501 + :type path: str + """ + + self._path = path + + @property + def read_only(self): + """Gets the read_only of this V1CephFSVolumeSource. # noqa: E501 + + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :return: The read_only of this V1CephFSVolumeSource. # noqa: E501 + :rtype: bool + """ + return self._read_only + + @read_only.setter + def read_only(self, read_only): + """Sets the read_only of this V1CephFSVolumeSource. + + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :param read_only: The read_only of this V1CephFSVolumeSource. # noqa: E501 + :type read_only: bool + """ + + self._read_only = read_only + + @property + def secret_file(self): + """Gets the secret_file of this V1CephFSVolumeSource. # noqa: E501 + + secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :return: The secret_file of this V1CephFSVolumeSource. # noqa: E501 + :rtype: str + """ + return self._secret_file + + @secret_file.setter + def secret_file(self, secret_file): + """Sets the secret_file of this V1CephFSVolumeSource. + + secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :param secret_file: The secret_file of this V1CephFSVolumeSource. # noqa: E501 + :type secret_file: str + """ + + self._secret_file = secret_file + + @property + def secret_ref(self): + """Gets the secret_ref of this V1CephFSVolumeSource. # noqa: E501 + + + :return: The secret_ref of this V1CephFSVolumeSource. # noqa: E501 + :rtype: V1LocalObjectReference + """ + return self._secret_ref + + @secret_ref.setter + def secret_ref(self, secret_ref): + """Sets the secret_ref of this V1CephFSVolumeSource. + + + :param secret_ref: The secret_ref of this V1CephFSVolumeSource. # noqa: E501 + :type secret_ref: V1LocalObjectReference + """ + + self._secret_ref = secret_ref + + @property + def user(self): + """Gets the user of this V1CephFSVolumeSource. # noqa: E501 + + user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :return: The user of this V1CephFSVolumeSource. # noqa: E501 + :rtype: str + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this V1CephFSVolumeSource. + + user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it # noqa: E501 + + :param user: The user of this V1CephFSVolumeSource. # noqa: E501 + :type user: str + """ + + self._user = user + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CephFSVolumeSource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CephFSVolumeSource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_certificate_signing_request.py b/kubernetes_asyncio/client/models/v1_certificate_signing_request.py new file mode 100644 index 0000000000..150cb52c40 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_certificate_signing_request.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CertificateSigningRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'spec': 'V1CertificateSigningRequestSpec', + 'status': 'V1CertificateSigningRequestStatus' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'spec': 'spec', + 'status': 'status' + } + + def __init__(self, api_version=None, kind=None, metadata=None, spec=None, status=None, local_vars_configuration=None): # noqa: E501 + """V1CertificateSigningRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._metadata = None + self._spec = None + self._status = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + self.spec = spec + if status is not None: + self.status = status + + @property + def api_version(self): + """Gets the api_version of this V1CertificateSigningRequest. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1CertificateSigningRequest. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1CertificateSigningRequest. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1CertificateSigningRequest. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1CertificateSigningRequest. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1CertificateSigningRequest. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CertificateSigningRequest. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1CertificateSigningRequest. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1CertificateSigningRequest. # noqa: E501 + + + :return: The metadata of this V1CertificateSigningRequest. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1CertificateSigningRequest. + + + :param metadata: The metadata of this V1CertificateSigningRequest. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def spec(self): + """Gets the spec of this V1CertificateSigningRequest. # noqa: E501 + + + :return: The spec of this V1CertificateSigningRequest. # noqa: E501 + :rtype: V1CertificateSigningRequestSpec + """ + return self._spec + + @spec.setter + def spec(self, spec): + """Sets the spec of this V1CertificateSigningRequest. + + + :param spec: The spec of this V1CertificateSigningRequest. # noqa: E501 + :type spec: V1CertificateSigningRequestSpec + """ + if self.local_vars_configuration.client_side_validation and spec is None: # noqa: E501 + raise ValueError("Invalid value for `spec`, must not be `None`") # noqa: E501 + + self._spec = spec + + @property + def status(self): + """Gets the status of this V1CertificateSigningRequest. # noqa: E501 + + + :return: The status of this V1CertificateSigningRequest. # noqa: E501 + :rtype: V1CertificateSigningRequestStatus + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1CertificateSigningRequest. + + + :param status: The status of this V1CertificateSigningRequest. # noqa: E501 + :type status: V1CertificateSigningRequestStatus + """ + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CertificateSigningRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CertificateSigningRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_certificate_signing_request_condition.py b/kubernetes_asyncio/client/models/v1_certificate_signing_request_condition.py new file mode 100644 index 0000000000..123561466e --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_certificate_signing_request_condition.py @@ -0,0 +1,275 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CertificateSigningRequestCondition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'last_transition_time': 'datetime', + 'last_update_time': 'datetime', + 'message': 'str', + 'reason': 'str', + 'status': 'str', + 'type': 'str' + } + + attribute_map = { + 'last_transition_time': 'lastTransitionTime', + 'last_update_time': 'lastUpdateTime', + 'message': 'message', + 'reason': 'reason', + 'status': 'status', + 'type': 'type' + } + + def __init__(self, last_transition_time=None, last_update_time=None, message=None, reason=None, status=None, type=None, local_vars_configuration=None): # noqa: E501 + """V1CertificateSigningRequestCondition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._last_transition_time = None + self._last_update_time = None + self._message = None + self._reason = None + self._status = None + self._type = None + self.discriminator = None + + if last_transition_time is not None: + self.last_transition_time = last_transition_time + if last_update_time is not None: + self.last_update_time = last_update_time + if message is not None: + self.message = message + if reason is not None: + self.reason = reason + self.status = status + self.type = type + + @property + def last_transition_time(self): + """Gets the last_transition_time of this V1CertificateSigningRequestCondition. # noqa: E501 + + lastTransitionTime is the time the condition last transitioned from one status to another. If unset, when a new condition type is added or an existing condition's status is changed, the server defaults this to the current time. # noqa: E501 + + :return: The last_transition_time of this V1CertificateSigningRequestCondition. # noqa: E501 + :rtype: datetime + """ + return self._last_transition_time + + @last_transition_time.setter + def last_transition_time(self, last_transition_time): + """Sets the last_transition_time of this V1CertificateSigningRequestCondition. + + lastTransitionTime is the time the condition last transitioned from one status to another. If unset, when a new condition type is added or an existing condition's status is changed, the server defaults this to the current time. # noqa: E501 + + :param last_transition_time: The last_transition_time of this V1CertificateSigningRequestCondition. # noqa: E501 + :type last_transition_time: datetime + """ + + self._last_transition_time = last_transition_time + + @property + def last_update_time(self): + """Gets the last_update_time of this V1CertificateSigningRequestCondition. # noqa: E501 + + lastUpdateTime is the time of the last update to this condition # noqa: E501 + + :return: The last_update_time of this V1CertificateSigningRequestCondition. # noqa: E501 + :rtype: datetime + """ + return self._last_update_time + + @last_update_time.setter + def last_update_time(self, last_update_time): + """Sets the last_update_time of this V1CertificateSigningRequestCondition. + + lastUpdateTime is the time of the last update to this condition # noqa: E501 + + :param last_update_time: The last_update_time of this V1CertificateSigningRequestCondition. # noqa: E501 + :type last_update_time: datetime + """ + + self._last_update_time = last_update_time + + @property + def message(self): + """Gets the message of this V1CertificateSigningRequestCondition. # noqa: E501 + + message contains a human readable message with details about the request state # noqa: E501 + + :return: The message of this V1CertificateSigningRequestCondition. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this V1CertificateSigningRequestCondition. + + message contains a human readable message with details about the request state # noqa: E501 + + :param message: The message of this V1CertificateSigningRequestCondition. # noqa: E501 + :type message: str + """ + + self._message = message + + @property + def reason(self): + """Gets the reason of this V1CertificateSigningRequestCondition. # noqa: E501 + + reason indicates a brief reason for the request state # noqa: E501 + + :return: The reason of this V1CertificateSigningRequestCondition. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this V1CertificateSigningRequestCondition. + + reason indicates a brief reason for the request state # noqa: E501 + + :param reason: The reason of this V1CertificateSigningRequestCondition. # noqa: E501 + :type reason: str + """ + + self._reason = reason + + @property + def status(self): + """Gets the status of this V1CertificateSigningRequestCondition. # noqa: E501 + + status of the condition, one of True, False, Unknown. Approved, Denied, and Failed conditions may not be \"False\" or \"Unknown\". # noqa: E501 + + :return: The status of this V1CertificateSigningRequestCondition. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1CertificateSigningRequestCondition. + + status of the condition, one of True, False, Unknown. Approved, Denied, and Failed conditions may not be \"False\" or \"Unknown\". # noqa: E501 + + :param status: The status of this V1CertificateSigningRequestCondition. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def type(self): + """Gets the type of this V1CertificateSigningRequestCondition. # noqa: E501 + + type of the condition. Known conditions are \"Approved\", \"Denied\", and \"Failed\". An \"Approved\" condition is added via the /approval subresource, indicating the request was approved and should be issued by the signer. A \"Denied\" condition is added via the /approval subresource, indicating the request was denied and should not be issued by the signer. A \"Failed\" condition is added via the /status subresource, indicating the signer failed to issue the certificate. Approved and Denied conditions are mutually exclusive. Approved, Denied, and Failed conditions cannot be removed once added. Only one condition of a given type is allowed. # noqa: E501 + + :return: The type of this V1CertificateSigningRequestCondition. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this V1CertificateSigningRequestCondition. + + type of the condition. Known conditions are \"Approved\", \"Denied\", and \"Failed\". An \"Approved\" condition is added via the /approval subresource, indicating the request was approved and should be issued by the signer. A \"Denied\" condition is added via the /approval subresource, indicating the request was denied and should not be issued by the signer. A \"Failed\" condition is added via the /status subresource, indicating the signer failed to issue the certificate. Approved and Denied conditions are mutually exclusive. Approved, Denied, and Failed conditions cannot be removed once added. Only one condition of a given type is allowed. # noqa: E501 + + :param type: The type of this V1CertificateSigningRequestCondition. # noqa: E501 + :type type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CertificateSigningRequestCondition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CertificateSigningRequestCondition): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_certificate_signing_request_list.py b/kubernetes_asyncio/client/models/v1_certificate_signing_request_list.py new file mode 100644 index 0000000000..aacfd23dc4 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_certificate_signing_request_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CertificateSigningRequestList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1CertificateSigningRequest]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1CertificateSigningRequestList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1CertificateSigningRequestList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1CertificateSigningRequestList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1CertificateSigningRequestList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1CertificateSigningRequestList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1CertificateSigningRequestList. # noqa: E501 + + items is a collection of CertificateSigningRequest objects # noqa: E501 + + :return: The items of this V1CertificateSigningRequestList. # noqa: E501 + :rtype: list[V1CertificateSigningRequest] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1CertificateSigningRequestList. + + items is a collection of CertificateSigningRequest objects # noqa: E501 + + :param items: The items of this V1CertificateSigningRequestList. # noqa: E501 + :type items: list[V1CertificateSigningRequest] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1CertificateSigningRequestList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1CertificateSigningRequestList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CertificateSigningRequestList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1CertificateSigningRequestList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1CertificateSigningRequestList. # noqa: E501 + + + :return: The metadata of this V1CertificateSigningRequestList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1CertificateSigningRequestList. + + + :param metadata: The metadata of this V1CertificateSigningRequestList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CertificateSigningRequestList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CertificateSigningRequestList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_certificate_signing_request_spec.py b/kubernetes_asyncio/client/models/v1_certificate_signing_request_spec.py new file mode 100644 index 0000000000..c59015058b --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_certificate_signing_request_spec.py @@ -0,0 +1,334 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CertificateSigningRequestSpec(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'expiration_seconds': 'int', + 'extra': 'dict[str, list[str]]', + 'groups': 'list[str]', + 'request': 'str', + 'signer_name': 'str', + 'uid': 'str', + 'usages': 'list[str]', + 'username': 'str' + } + + attribute_map = { + 'expiration_seconds': 'expirationSeconds', + 'extra': 'extra', + 'groups': 'groups', + 'request': 'request', + 'signer_name': 'signerName', + 'uid': 'uid', + 'usages': 'usages', + 'username': 'username' + } + + def __init__(self, expiration_seconds=None, extra=None, groups=None, request=None, signer_name=None, uid=None, usages=None, username=None, local_vars_configuration=None): # noqa: E501 + """V1CertificateSigningRequestSpec - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._expiration_seconds = None + self._extra = None + self._groups = None + self._request = None + self._signer_name = None + self._uid = None + self._usages = None + self._username = None + self.discriminator = None + + if expiration_seconds is not None: + self.expiration_seconds = expiration_seconds + if extra is not None: + self.extra = extra + if groups is not None: + self.groups = groups + self.request = request + self.signer_name = signer_name + if uid is not None: + self.uid = uid + if usages is not None: + self.usages = usages + if username is not None: + self.username = username + + @property + def expiration_seconds(self): + """Gets the expiration_seconds of this V1CertificateSigningRequestSpec. # noqa: E501 + + expirationSeconds is the requested duration of validity of the issued certificate. The certificate signer may issue a certificate with a different validity duration so a client must check the delta between the notBefore and and notAfter fields in the issued certificate to determine the actual duration. The v1.22+ in-tree implementations of the well-known Kubernetes signers will honor this field as long as the requested duration is not greater than the maximum duration they will honor per the --cluster-signing-duration CLI flag to the Kubernetes controller manager. Certificate signers may not honor this field for various reasons: 1. Old signer that is unaware of the field (such as the in-tree implementations prior to v1.22) 2. Signer whose configured maximum is shorter than the requested duration 3. Signer whose configured minimum is longer than the requested duration The minimum valid value for expirationSeconds is 600, i.e. 10 minutes. # noqa: E501 + + :return: The expiration_seconds of this V1CertificateSigningRequestSpec. # noqa: E501 + :rtype: int + """ + return self._expiration_seconds + + @expiration_seconds.setter + def expiration_seconds(self, expiration_seconds): + """Sets the expiration_seconds of this V1CertificateSigningRequestSpec. + + expirationSeconds is the requested duration of validity of the issued certificate. The certificate signer may issue a certificate with a different validity duration so a client must check the delta between the notBefore and and notAfter fields in the issued certificate to determine the actual duration. The v1.22+ in-tree implementations of the well-known Kubernetes signers will honor this field as long as the requested duration is not greater than the maximum duration they will honor per the --cluster-signing-duration CLI flag to the Kubernetes controller manager. Certificate signers may not honor this field for various reasons: 1. Old signer that is unaware of the field (such as the in-tree implementations prior to v1.22) 2. Signer whose configured maximum is shorter than the requested duration 3. Signer whose configured minimum is longer than the requested duration The minimum valid value for expirationSeconds is 600, i.e. 10 minutes. # noqa: E501 + + :param expiration_seconds: The expiration_seconds of this V1CertificateSigningRequestSpec. # noqa: E501 + :type expiration_seconds: int + """ + + self._expiration_seconds = expiration_seconds + + @property + def extra(self): + """Gets the extra of this V1CertificateSigningRequestSpec. # noqa: E501 + + extra contains extra attributes of the user that created the CertificateSigningRequest. Populated by the API server on creation and immutable. # noqa: E501 + + :return: The extra of this V1CertificateSigningRequestSpec. # noqa: E501 + :rtype: dict[str, list[str]] + """ + return self._extra + + @extra.setter + def extra(self, extra): + """Sets the extra of this V1CertificateSigningRequestSpec. + + extra contains extra attributes of the user that created the CertificateSigningRequest. Populated by the API server on creation and immutable. # noqa: E501 + + :param extra: The extra of this V1CertificateSigningRequestSpec. # noqa: E501 + :type extra: dict[str, list[str]] + """ + + self._extra = extra + + @property + def groups(self): + """Gets the groups of this V1CertificateSigningRequestSpec. # noqa: E501 + + groups contains group membership of the user that created the CertificateSigningRequest. Populated by the API server on creation and immutable. # noqa: E501 + + :return: The groups of this V1CertificateSigningRequestSpec. # noqa: E501 + :rtype: list[str] + """ + return self._groups + + @groups.setter + def groups(self, groups): + """Sets the groups of this V1CertificateSigningRequestSpec. + + groups contains group membership of the user that created the CertificateSigningRequest. Populated by the API server on creation and immutable. # noqa: E501 + + :param groups: The groups of this V1CertificateSigningRequestSpec. # noqa: E501 + :type groups: list[str] + """ + + self._groups = groups + + @property + def request(self): + """Gets the request of this V1CertificateSigningRequestSpec. # noqa: E501 + + request contains an x509 certificate signing request encoded in a \"CERTIFICATE REQUEST\" PEM block. When serialized as JSON or YAML, the data is additionally base64-encoded. # noqa: E501 + + :return: The request of this V1CertificateSigningRequestSpec. # noqa: E501 + :rtype: str + """ + return self._request + + @request.setter + def request(self, request): + """Sets the request of this V1CertificateSigningRequestSpec. + + request contains an x509 certificate signing request encoded in a \"CERTIFICATE REQUEST\" PEM block. When serialized as JSON or YAML, the data is additionally base64-encoded. # noqa: E501 + + :param request: The request of this V1CertificateSigningRequestSpec. # noqa: E501 + :type request: str + """ + if self.local_vars_configuration.client_side_validation and request is None: # noqa: E501 + raise ValueError("Invalid value for `request`, must not be `None`") # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + request is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', request)): # noqa: E501 + raise ValueError(r"Invalid value for `request`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 + + self._request = request + + @property + def signer_name(self): + """Gets the signer_name of this V1CertificateSigningRequestSpec. # noqa: E501 + + signerName indicates the requested signer, and is a qualified name. List/watch requests for CertificateSigningRequests can filter on this field using a \"spec.signerName=NAME\" fieldSelector. Well-known Kubernetes signers are: 1. \"kubernetes.io/kube-apiserver-client\": issues client certificates that can be used to authenticate to kube-apiserver. Requests for this signer are never auto-approved by kube-controller-manager, can be issued by the \"csrsigning\" controller in kube-controller-manager. 2. \"kubernetes.io/kube-apiserver-client-kubelet\": issues client certificates that kubelets use to authenticate to kube-apiserver. Requests for this signer can be auto-approved by the \"csrapproving\" controller in kube-controller-manager, and can be issued by the \"csrsigning\" controller in kube-controller-manager. 3. \"kubernetes.io/kubelet-serving\" issues serving certificates that kubelets use to serve TLS endpoints, which kube-apiserver can connect to securely. Requests for this signer are never auto-approved by kube-controller-manager, and can be issued by the \"csrsigning\" controller in kube-controller-manager. More details are available at https://k8s.io/docs/reference/access-authn-authz/certificate-signing-requests/#kubernetes-signers Custom signerNames can also be specified. The signer defines: 1. Trust distribution: how trust (CA bundles) are distributed. 2. Permitted subjects: and behavior when a disallowed subject is requested. 3. Required, permitted, or forbidden x509 extensions in the request (including whether subjectAltNames are allowed, which types, restrictions on allowed values) and behavior when a disallowed extension is requested. 4. Required, permitted, or forbidden key usages / extended key usages. 5. Expiration/certificate lifetime: whether it is fixed by the signer, configurable by the admin. 6. Whether or not requests for CA certificates are allowed. # noqa: E501 + + :return: The signer_name of this V1CertificateSigningRequestSpec. # noqa: E501 + :rtype: str + """ + return self._signer_name + + @signer_name.setter + def signer_name(self, signer_name): + """Sets the signer_name of this V1CertificateSigningRequestSpec. + + signerName indicates the requested signer, and is a qualified name. List/watch requests for CertificateSigningRequests can filter on this field using a \"spec.signerName=NAME\" fieldSelector. Well-known Kubernetes signers are: 1. \"kubernetes.io/kube-apiserver-client\": issues client certificates that can be used to authenticate to kube-apiserver. Requests for this signer are never auto-approved by kube-controller-manager, can be issued by the \"csrsigning\" controller in kube-controller-manager. 2. \"kubernetes.io/kube-apiserver-client-kubelet\": issues client certificates that kubelets use to authenticate to kube-apiserver. Requests for this signer can be auto-approved by the \"csrapproving\" controller in kube-controller-manager, and can be issued by the \"csrsigning\" controller in kube-controller-manager. 3. \"kubernetes.io/kubelet-serving\" issues serving certificates that kubelets use to serve TLS endpoints, which kube-apiserver can connect to securely. Requests for this signer are never auto-approved by kube-controller-manager, and can be issued by the \"csrsigning\" controller in kube-controller-manager. More details are available at https://k8s.io/docs/reference/access-authn-authz/certificate-signing-requests/#kubernetes-signers Custom signerNames can also be specified. The signer defines: 1. Trust distribution: how trust (CA bundles) are distributed. 2. Permitted subjects: and behavior when a disallowed subject is requested. 3. Required, permitted, or forbidden x509 extensions in the request (including whether subjectAltNames are allowed, which types, restrictions on allowed values) and behavior when a disallowed extension is requested. 4. Required, permitted, or forbidden key usages / extended key usages. 5. Expiration/certificate lifetime: whether it is fixed by the signer, configurable by the admin. 6. Whether or not requests for CA certificates are allowed. # noqa: E501 + + :param signer_name: The signer_name of this V1CertificateSigningRequestSpec. # noqa: E501 + :type signer_name: str + """ + if self.local_vars_configuration.client_side_validation and signer_name is None: # noqa: E501 + raise ValueError("Invalid value for `signer_name`, must not be `None`") # noqa: E501 + + self._signer_name = signer_name + + @property + def uid(self): + """Gets the uid of this V1CertificateSigningRequestSpec. # noqa: E501 + + uid contains the uid of the user that created the CertificateSigningRequest. Populated by the API server on creation and immutable. # noqa: E501 + + :return: The uid of this V1CertificateSigningRequestSpec. # noqa: E501 + :rtype: str + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this V1CertificateSigningRequestSpec. + + uid contains the uid of the user that created the CertificateSigningRequest. Populated by the API server on creation and immutable. # noqa: E501 + + :param uid: The uid of this V1CertificateSigningRequestSpec. # noqa: E501 + :type uid: str + """ + + self._uid = uid + + @property + def usages(self): + """Gets the usages of this V1CertificateSigningRequestSpec. # noqa: E501 + + usages specifies a set of key usages requested in the issued certificate. Requests for TLS client certificates typically request: \"digital signature\", \"key encipherment\", \"client auth\". Requests for TLS serving certificates typically request: \"key encipherment\", \"digital signature\", \"server auth\". Valid values are: \"signing\", \"digital signature\", \"content commitment\", \"key encipherment\", \"key agreement\", \"data encipherment\", \"cert sign\", \"crl sign\", \"encipher only\", \"decipher only\", \"any\", \"server auth\", \"client auth\", \"code signing\", \"email protection\", \"s/mime\", \"ipsec end system\", \"ipsec tunnel\", \"ipsec user\", \"timestamping\", \"ocsp signing\", \"microsoft sgc\", \"netscape sgc\" # noqa: E501 + + :return: The usages of this V1CertificateSigningRequestSpec. # noqa: E501 + :rtype: list[str] + """ + return self._usages + + @usages.setter + def usages(self, usages): + """Sets the usages of this V1CertificateSigningRequestSpec. + + usages specifies a set of key usages requested in the issued certificate. Requests for TLS client certificates typically request: \"digital signature\", \"key encipherment\", \"client auth\". Requests for TLS serving certificates typically request: \"key encipherment\", \"digital signature\", \"server auth\". Valid values are: \"signing\", \"digital signature\", \"content commitment\", \"key encipherment\", \"key agreement\", \"data encipherment\", \"cert sign\", \"crl sign\", \"encipher only\", \"decipher only\", \"any\", \"server auth\", \"client auth\", \"code signing\", \"email protection\", \"s/mime\", \"ipsec end system\", \"ipsec tunnel\", \"ipsec user\", \"timestamping\", \"ocsp signing\", \"microsoft sgc\", \"netscape sgc\" # noqa: E501 + + :param usages: The usages of this V1CertificateSigningRequestSpec. # noqa: E501 + :type usages: list[str] + """ + + self._usages = usages + + @property + def username(self): + """Gets the username of this V1CertificateSigningRequestSpec. # noqa: E501 + + username contains the name of the user that created the CertificateSigningRequest. Populated by the API server on creation and immutable. # noqa: E501 + + :return: The username of this V1CertificateSigningRequestSpec. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this V1CertificateSigningRequestSpec. + + username contains the name of the user that created the CertificateSigningRequest. Populated by the API server on creation and immutable. # noqa: E501 + + :param username: The username of this V1CertificateSigningRequestSpec. # noqa: E501 + :type username: str + """ + + self._username = username + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CertificateSigningRequestSpec): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CertificateSigningRequestSpec): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_certificate_signing_request_status.py b/kubernetes_asyncio/client/models/v1_certificate_signing_request_status.py new file mode 100644 index 0000000000..26800938e9 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_certificate_signing_request_status.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CertificateSigningRequestStatus(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'certificate': 'str', + 'conditions': 'list[V1CertificateSigningRequestCondition]' + } + + attribute_map = { + 'certificate': 'certificate', + 'conditions': 'conditions' + } + + def __init__(self, certificate=None, conditions=None, local_vars_configuration=None): # noqa: E501 + """V1CertificateSigningRequestStatus - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._certificate = None + self._conditions = None + self.discriminator = None + + if certificate is not None: + self.certificate = certificate + if conditions is not None: + self.conditions = conditions + + @property + def certificate(self): + """Gets the certificate of this V1CertificateSigningRequestStatus. # noqa: E501 + + certificate is populated with an issued certificate by the signer after an Approved condition is present. This field is set via the /status subresource. Once populated, this field is immutable. If the certificate signing request is denied, a condition of type \"Denied\" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type \"Failed\" is added and this field remains empty. Validation requirements: 1. certificate must contain one or more PEM blocks. 2. All PEM blocks must have the \"CERTIFICATE\" label, contain no headers, and the encoded data must be a BER-encoded ASN.1 Certificate structure as described in section 4 of RFC5280. 3. Non-PEM content may appear before or after the \"CERTIFICATE\" PEM blocks and is unvalidated, to allow for explanatory text as described in section 5.2 of RFC7468. If more than one PEM block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes. The certificate is encoded in PEM format. When serialized as JSON or YAML, the data is additionally base64-encoded, so it consists of: base64( -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ) # noqa: E501 + + :return: The certificate of this V1CertificateSigningRequestStatus. # noqa: E501 + :rtype: str + """ + return self._certificate + + @certificate.setter + def certificate(self, certificate): + """Sets the certificate of this V1CertificateSigningRequestStatus. + + certificate is populated with an issued certificate by the signer after an Approved condition is present. This field is set via the /status subresource. Once populated, this field is immutable. If the certificate signing request is denied, a condition of type \"Denied\" is added and this field remains empty. If the signer cannot issue the certificate, a condition of type \"Failed\" is added and this field remains empty. Validation requirements: 1. certificate must contain one or more PEM blocks. 2. All PEM blocks must have the \"CERTIFICATE\" label, contain no headers, and the encoded data must be a BER-encoded ASN.1 Certificate structure as described in section 4 of RFC5280. 3. Non-PEM content may appear before or after the \"CERTIFICATE\" PEM blocks and is unvalidated, to allow for explanatory text as described in section 5.2 of RFC7468. If more than one PEM block is present, and the definition of the requested spec.signerName does not indicate otherwise, the first block is the issued certificate, and subsequent blocks should be treated as intermediate certificates and presented in TLS handshakes. The certificate is encoded in PEM format. When serialized as JSON or YAML, the data is additionally base64-encoded, so it consists of: base64( -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- ) # noqa: E501 + + :param certificate: The certificate of this V1CertificateSigningRequestStatus. # noqa: E501 + :type certificate: str + """ + if (self.local_vars_configuration.client_side_validation and + certificate is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', certificate)): # noqa: E501 + raise ValueError(r"Invalid value for `certificate`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 + + self._certificate = certificate + + @property + def conditions(self): + """Gets the conditions of this V1CertificateSigningRequestStatus. # noqa: E501 + + conditions applied to the request. Known conditions are \"Approved\", \"Denied\", and \"Failed\". # noqa: E501 + + :return: The conditions of this V1CertificateSigningRequestStatus. # noqa: E501 + :rtype: list[V1CertificateSigningRequestCondition] + """ + return self._conditions + + @conditions.setter + def conditions(self, conditions): + """Sets the conditions of this V1CertificateSigningRequestStatus. + + conditions applied to the request. Known conditions are \"Approved\", \"Denied\", and \"Failed\". # noqa: E501 + + :param conditions: The conditions of this V1CertificateSigningRequestStatus. # noqa: E501 + :type conditions: list[V1CertificateSigningRequestCondition] + """ + + self._conditions = conditions + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CertificateSigningRequestStatus): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CertificateSigningRequestStatus): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_cinder_persistent_volume_source.py b/kubernetes_asyncio/client/models/v1_cinder_persistent_volume_source.py new file mode 100644 index 0000000000..ad02a3241c --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_cinder_persistent_volume_source.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CinderPersistentVolumeSource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'fs_type': 'str', + 'read_only': 'bool', + 'secret_ref': 'V1SecretReference', + 'volume_id': 'str' + } + + attribute_map = { + 'fs_type': 'fsType', + 'read_only': 'readOnly', + 'secret_ref': 'secretRef', + 'volume_id': 'volumeID' + } + + def __init__(self, fs_type=None, read_only=None, secret_ref=None, volume_id=None, local_vars_configuration=None): # noqa: E501 + """V1CinderPersistentVolumeSource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._fs_type = None + self._read_only = None + self._secret_ref = None + self._volume_id = None + self.discriminator = None + + if fs_type is not None: + self.fs_type = fs_type + if read_only is not None: + self.read_only = read_only + if secret_ref is not None: + self.secret_ref = secret_ref + self.volume_id = volume_id + + @property + def fs_type(self): + """Gets the fs_type of this V1CinderPersistentVolumeSource. # noqa: E501 + + fsType Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md # noqa: E501 + + :return: The fs_type of this V1CinderPersistentVolumeSource. # noqa: E501 + :rtype: str + """ + return self._fs_type + + @fs_type.setter + def fs_type(self, fs_type): + """Sets the fs_type of this V1CinderPersistentVolumeSource. + + fsType Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md # noqa: E501 + + :param fs_type: The fs_type of this V1CinderPersistentVolumeSource. # noqa: E501 + :type fs_type: str + """ + + self._fs_type = fs_type + + @property + def read_only(self): + """Gets the read_only of this V1CinderPersistentVolumeSource. # noqa: E501 + + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md # noqa: E501 + + :return: The read_only of this V1CinderPersistentVolumeSource. # noqa: E501 + :rtype: bool + """ + return self._read_only + + @read_only.setter + def read_only(self, read_only): + """Sets the read_only of this V1CinderPersistentVolumeSource. + + readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md # noqa: E501 + + :param read_only: The read_only of this V1CinderPersistentVolumeSource. # noqa: E501 + :type read_only: bool + """ + + self._read_only = read_only + + @property + def secret_ref(self): + """Gets the secret_ref of this V1CinderPersistentVolumeSource. # noqa: E501 + + + :return: The secret_ref of this V1CinderPersistentVolumeSource. # noqa: E501 + :rtype: V1SecretReference + """ + return self._secret_ref + + @secret_ref.setter + def secret_ref(self, secret_ref): + """Sets the secret_ref of this V1CinderPersistentVolumeSource. + + + :param secret_ref: The secret_ref of this V1CinderPersistentVolumeSource. # noqa: E501 + :type secret_ref: V1SecretReference + """ + + self._secret_ref = secret_ref + + @property + def volume_id(self): + """Gets the volume_id of this V1CinderPersistentVolumeSource. # noqa: E501 + + volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md # noqa: E501 + + :return: The volume_id of this V1CinderPersistentVolumeSource. # noqa: E501 + :rtype: str + """ + return self._volume_id + + @volume_id.setter + def volume_id(self, volume_id): + """Sets the volume_id of this V1CinderPersistentVolumeSource. + + volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md # noqa: E501 + + :param volume_id: The volume_id of this V1CinderPersistentVolumeSource. # noqa: E501 + :type volume_id: str + """ + if self.local_vars_configuration.client_side_validation and volume_id is None: # noqa: E501 + raise ValueError("Invalid value for `volume_id`, must not be `None`") # noqa: E501 + + self._volume_id = volume_id + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CinderPersistentVolumeSource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CinderPersistentVolumeSource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_cinder_volume_source.py b/kubernetes_asyncio/client/models/v1_cinder_volume_source.py new file mode 100644 index 0000000000..2d0d643c02 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_cinder_volume_source.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CinderVolumeSource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'fs_type': 'str', + 'read_only': 'bool', + 'secret_ref': 'V1LocalObjectReference', + 'volume_id': 'str' + } + + attribute_map = { + 'fs_type': 'fsType', + 'read_only': 'readOnly', + 'secret_ref': 'secretRef', + 'volume_id': 'volumeID' + } + + def __init__(self, fs_type=None, read_only=None, secret_ref=None, volume_id=None, local_vars_configuration=None): # noqa: E501 + """V1CinderVolumeSource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._fs_type = None + self._read_only = None + self._secret_ref = None + self._volume_id = None + self.discriminator = None + + if fs_type is not None: + self.fs_type = fs_type + if read_only is not None: + self.read_only = read_only + if secret_ref is not None: + self.secret_ref = secret_ref + self.volume_id = volume_id + + @property + def fs_type(self): + """Gets the fs_type of this V1CinderVolumeSource. # noqa: E501 + + fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md # noqa: E501 + + :return: The fs_type of this V1CinderVolumeSource. # noqa: E501 + :rtype: str + """ + return self._fs_type + + @fs_type.setter + def fs_type(self, fs_type): + """Sets the fs_type of this V1CinderVolumeSource. + + fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md # noqa: E501 + + :param fs_type: The fs_type of this V1CinderVolumeSource. # noqa: E501 + :type fs_type: str + """ + + self._fs_type = fs_type + + @property + def read_only(self): + """Gets the read_only of this V1CinderVolumeSource. # noqa: E501 + + readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md # noqa: E501 + + :return: The read_only of this V1CinderVolumeSource. # noqa: E501 + :rtype: bool + """ + return self._read_only + + @read_only.setter + def read_only(self, read_only): + """Sets the read_only of this V1CinderVolumeSource. + + readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md # noqa: E501 + + :param read_only: The read_only of this V1CinderVolumeSource. # noqa: E501 + :type read_only: bool + """ + + self._read_only = read_only + + @property + def secret_ref(self): + """Gets the secret_ref of this V1CinderVolumeSource. # noqa: E501 + + + :return: The secret_ref of this V1CinderVolumeSource. # noqa: E501 + :rtype: V1LocalObjectReference + """ + return self._secret_ref + + @secret_ref.setter + def secret_ref(self, secret_ref): + """Sets the secret_ref of this V1CinderVolumeSource. + + + :param secret_ref: The secret_ref of this V1CinderVolumeSource. # noqa: E501 + :type secret_ref: V1LocalObjectReference + """ + + self._secret_ref = secret_ref + + @property + def volume_id(self): + """Gets the volume_id of this V1CinderVolumeSource. # noqa: E501 + + volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md # noqa: E501 + + :return: The volume_id of this V1CinderVolumeSource. # noqa: E501 + :rtype: str + """ + return self._volume_id + + @volume_id.setter + def volume_id(self, volume_id): + """Sets the volume_id of this V1CinderVolumeSource. + + volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md # noqa: E501 + + :param volume_id: The volume_id of this V1CinderVolumeSource. # noqa: E501 + :type volume_id: str + """ + if self.local_vars_configuration.client_side_validation and volume_id is None: # noqa: E501 + raise ValueError("Invalid value for `volume_id`, must not be `None`") # noqa: E501 + + self._volume_id = volume_id + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CinderVolumeSource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CinderVolumeSource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_client_ip_config.py b/kubernetes_asyncio/client/models/v1_client_ip_config.py new file mode 100644 index 0000000000..57e4eb4fae --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_client_ip_config.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ClientIPConfig(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'timeout_seconds': 'int' + } + + attribute_map = { + 'timeout_seconds': 'timeoutSeconds' + } + + def __init__(self, timeout_seconds=None, local_vars_configuration=None): # noqa: E501 + """V1ClientIPConfig - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._timeout_seconds = None + self.discriminator = None + + if timeout_seconds is not None: + self.timeout_seconds = timeout_seconds + + @property + def timeout_seconds(self): + """Gets the timeout_seconds of this V1ClientIPConfig. # noqa: E501 + + timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == \"ClientIP\". Default value is 10800(for 3 hours). # noqa: E501 + + :return: The timeout_seconds of this V1ClientIPConfig. # noqa: E501 + :rtype: int + """ + return self._timeout_seconds + + @timeout_seconds.setter + def timeout_seconds(self, timeout_seconds): + """Sets the timeout_seconds of this V1ClientIPConfig. + + timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == \"ClientIP\". Default value is 10800(for 3 hours). # noqa: E501 + + :param timeout_seconds: The timeout_seconds of this V1ClientIPConfig. # noqa: E501 + :type timeout_seconds: int + """ + + self._timeout_seconds = timeout_seconds + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ClientIPConfig): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ClientIPConfig): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_cluster_role.py b/kubernetes_asyncio/client/models/v1_cluster_role.py new file mode 100644 index 0000000000..c7ebc76455 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_cluster_role.py @@ -0,0 +1,241 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ClusterRole(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'aggregation_rule': 'V1AggregationRule', + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'rules': 'list[V1PolicyRule]' + } + + attribute_map = { + 'aggregation_rule': 'aggregationRule', + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'rules': 'rules' + } + + def __init__(self, aggregation_rule=None, api_version=None, kind=None, metadata=None, rules=None, local_vars_configuration=None): # noqa: E501 + """V1ClusterRole - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._aggregation_rule = None + self._api_version = None + self._kind = None + self._metadata = None + self._rules = None + self.discriminator = None + + if aggregation_rule is not None: + self.aggregation_rule = aggregation_rule + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + if rules is not None: + self.rules = rules + + @property + def aggregation_rule(self): + """Gets the aggregation_rule of this V1ClusterRole. # noqa: E501 + + + :return: The aggregation_rule of this V1ClusterRole. # noqa: E501 + :rtype: V1AggregationRule + """ + return self._aggregation_rule + + @aggregation_rule.setter + def aggregation_rule(self, aggregation_rule): + """Sets the aggregation_rule of this V1ClusterRole. + + + :param aggregation_rule: The aggregation_rule of this V1ClusterRole. # noqa: E501 + :type aggregation_rule: V1AggregationRule + """ + + self._aggregation_rule = aggregation_rule + + @property + def api_version(self): + """Gets the api_version of this V1ClusterRole. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1ClusterRole. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1ClusterRole. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1ClusterRole. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1ClusterRole. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1ClusterRole. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1ClusterRole. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1ClusterRole. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1ClusterRole. # noqa: E501 + + + :return: The metadata of this V1ClusterRole. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1ClusterRole. + + + :param metadata: The metadata of this V1ClusterRole. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def rules(self): + """Gets the rules of this V1ClusterRole. # noqa: E501 + + Rules holds all the PolicyRules for this ClusterRole # noqa: E501 + + :return: The rules of this V1ClusterRole. # noqa: E501 + :rtype: list[V1PolicyRule] + """ + return self._rules + + @rules.setter + def rules(self, rules): + """Sets the rules of this V1ClusterRole. + + Rules holds all the PolicyRules for this ClusterRole # noqa: E501 + + :param rules: The rules of this V1ClusterRole. # noqa: E501 + :type rules: list[V1PolicyRule] + """ + + self._rules = rules + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ClusterRole): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ClusterRole): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_cluster_role_binding.py b/kubernetes_asyncio/client/models/v1_cluster_role_binding.py new file mode 100644 index 0000000000..94f60c5928 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_cluster_role_binding.py @@ -0,0 +1,242 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ClusterRoleBinding(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'role_ref': 'V1RoleRef', + 'subjects': 'list[RbacV1Subject]' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'role_ref': 'roleRef', + 'subjects': 'subjects' + } + + def __init__(self, api_version=None, kind=None, metadata=None, role_ref=None, subjects=None, local_vars_configuration=None): # noqa: E501 + """V1ClusterRoleBinding - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._metadata = None + self._role_ref = None + self._subjects = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + self.role_ref = role_ref + if subjects is not None: + self.subjects = subjects + + @property + def api_version(self): + """Gets the api_version of this V1ClusterRoleBinding. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1ClusterRoleBinding. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1ClusterRoleBinding. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1ClusterRoleBinding. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1ClusterRoleBinding. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1ClusterRoleBinding. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1ClusterRoleBinding. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1ClusterRoleBinding. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1ClusterRoleBinding. # noqa: E501 + + + :return: The metadata of this V1ClusterRoleBinding. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1ClusterRoleBinding. + + + :param metadata: The metadata of this V1ClusterRoleBinding. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def role_ref(self): + """Gets the role_ref of this V1ClusterRoleBinding. # noqa: E501 + + + :return: The role_ref of this V1ClusterRoleBinding. # noqa: E501 + :rtype: V1RoleRef + """ + return self._role_ref + + @role_ref.setter + def role_ref(self, role_ref): + """Sets the role_ref of this V1ClusterRoleBinding. + + + :param role_ref: The role_ref of this V1ClusterRoleBinding. # noqa: E501 + :type role_ref: V1RoleRef + """ + if self.local_vars_configuration.client_side_validation and role_ref is None: # noqa: E501 + raise ValueError("Invalid value for `role_ref`, must not be `None`") # noqa: E501 + + self._role_ref = role_ref + + @property + def subjects(self): + """Gets the subjects of this V1ClusterRoleBinding. # noqa: E501 + + Subjects holds references to the objects the role applies to. # noqa: E501 + + :return: The subjects of this V1ClusterRoleBinding. # noqa: E501 + :rtype: list[RbacV1Subject] + """ + return self._subjects + + @subjects.setter + def subjects(self, subjects): + """Sets the subjects of this V1ClusterRoleBinding. + + Subjects holds references to the objects the role applies to. # noqa: E501 + + :param subjects: The subjects of this V1ClusterRoleBinding. # noqa: E501 + :type subjects: list[RbacV1Subject] + """ + + self._subjects = subjects + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ClusterRoleBinding): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ClusterRoleBinding): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_cluster_role_binding_list.py b/kubernetes_asyncio/client/models/v1_cluster_role_binding_list.py new file mode 100644 index 0000000000..a75ca47b26 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_cluster_role_binding_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ClusterRoleBindingList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1ClusterRoleBinding]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1ClusterRoleBindingList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1ClusterRoleBindingList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1ClusterRoleBindingList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1ClusterRoleBindingList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1ClusterRoleBindingList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1ClusterRoleBindingList. # noqa: E501 + + Items is a list of ClusterRoleBindings # noqa: E501 + + :return: The items of this V1ClusterRoleBindingList. # noqa: E501 + :rtype: list[V1ClusterRoleBinding] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1ClusterRoleBindingList. + + Items is a list of ClusterRoleBindings # noqa: E501 + + :param items: The items of this V1ClusterRoleBindingList. # noqa: E501 + :type items: list[V1ClusterRoleBinding] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1ClusterRoleBindingList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1ClusterRoleBindingList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1ClusterRoleBindingList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1ClusterRoleBindingList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1ClusterRoleBindingList. # noqa: E501 + + + :return: The metadata of this V1ClusterRoleBindingList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1ClusterRoleBindingList. + + + :param metadata: The metadata of this V1ClusterRoleBindingList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ClusterRoleBindingList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ClusterRoleBindingList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_cluster_role_list.py b/kubernetes_asyncio/client/models/v1_cluster_role_list.py new file mode 100644 index 0000000000..4783b72d03 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_cluster_role_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ClusterRoleList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1ClusterRole]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1ClusterRoleList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1ClusterRoleList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1ClusterRoleList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1ClusterRoleList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1ClusterRoleList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1ClusterRoleList. # noqa: E501 + + Items is a list of ClusterRoles # noqa: E501 + + :return: The items of this V1ClusterRoleList. # noqa: E501 + :rtype: list[V1ClusterRole] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1ClusterRoleList. + + Items is a list of ClusterRoles # noqa: E501 + + :param items: The items of this V1ClusterRoleList. # noqa: E501 + :type items: list[V1ClusterRole] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1ClusterRoleList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1ClusterRoleList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1ClusterRoleList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1ClusterRoleList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1ClusterRoleList. # noqa: E501 + + + :return: The metadata of this V1ClusterRoleList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1ClusterRoleList. + + + :param metadata: The metadata of this V1ClusterRoleList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ClusterRoleList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ClusterRoleList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_cluster_trust_bundle_projection.py b/kubernetes_asyncio/client/models/v1_cluster_trust_bundle_projection.py new file mode 100644 index 0000000000..9f202608c1 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_cluster_trust_bundle_projection.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ClusterTrustBundleProjection(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'label_selector': 'V1LabelSelector', + 'name': 'str', + 'optional': 'bool', + 'path': 'str', + 'signer_name': 'str' + } + + attribute_map = { + 'label_selector': 'labelSelector', + 'name': 'name', + 'optional': 'optional', + 'path': 'path', + 'signer_name': 'signerName' + } + + def __init__(self, label_selector=None, name=None, optional=None, path=None, signer_name=None, local_vars_configuration=None): # noqa: E501 + """V1ClusterTrustBundleProjection - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._label_selector = None + self._name = None + self._optional = None + self._path = None + self._signer_name = None + self.discriminator = None + + if label_selector is not None: + self.label_selector = label_selector + if name is not None: + self.name = name + if optional is not None: + self.optional = optional + self.path = path + if signer_name is not None: + self.signer_name = signer_name + + @property + def label_selector(self): + """Gets the label_selector of this V1ClusterTrustBundleProjection. # noqa: E501 + + + :return: The label_selector of this V1ClusterTrustBundleProjection. # noqa: E501 + :rtype: V1LabelSelector + """ + return self._label_selector + + @label_selector.setter + def label_selector(self, label_selector): + """Sets the label_selector of this V1ClusterTrustBundleProjection. + + + :param label_selector: The label_selector of this V1ClusterTrustBundleProjection. # noqa: E501 + :type label_selector: V1LabelSelector + """ + + self._label_selector = label_selector + + @property + def name(self): + """Gets the name of this V1ClusterTrustBundleProjection. # noqa: E501 + + Select a single ClusterTrustBundle by object name. Mutually-exclusive with signerName and labelSelector. # noqa: E501 + + :return: The name of this V1ClusterTrustBundleProjection. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1ClusterTrustBundleProjection. + + Select a single ClusterTrustBundle by object name. Mutually-exclusive with signerName and labelSelector. # noqa: E501 + + :param name: The name of this V1ClusterTrustBundleProjection. # noqa: E501 + :type name: str + """ + + self._name = name + + @property + def optional(self): + """Gets the optional of this V1ClusterTrustBundleProjection. # noqa: E501 + + If true, don't block pod startup if the referenced ClusterTrustBundle(s) aren't available. If using name, then the named ClusterTrustBundle is allowed not to exist. If using signerName, then the combination of signerName and labelSelector is allowed to match zero ClusterTrustBundles. # noqa: E501 + + :return: The optional of this V1ClusterTrustBundleProjection. # noqa: E501 + :rtype: bool + """ + return self._optional + + @optional.setter + def optional(self, optional): + """Sets the optional of this V1ClusterTrustBundleProjection. + + If true, don't block pod startup if the referenced ClusterTrustBundle(s) aren't available. If using name, then the named ClusterTrustBundle is allowed not to exist. If using signerName, then the combination of signerName and labelSelector is allowed to match zero ClusterTrustBundles. # noqa: E501 + + :param optional: The optional of this V1ClusterTrustBundleProjection. # noqa: E501 + :type optional: bool + """ + + self._optional = optional + + @property + def path(self): + """Gets the path of this V1ClusterTrustBundleProjection. # noqa: E501 + + Relative path from the volume root to write the bundle. # noqa: E501 + + :return: The path of this V1ClusterTrustBundleProjection. # noqa: E501 + :rtype: str + """ + return self._path + + @path.setter + def path(self, path): + """Sets the path of this V1ClusterTrustBundleProjection. + + Relative path from the volume root to write the bundle. # noqa: E501 + + :param path: The path of this V1ClusterTrustBundleProjection. # noqa: E501 + :type path: str + """ + if self.local_vars_configuration.client_side_validation and path is None: # noqa: E501 + raise ValueError("Invalid value for `path`, must not be `None`") # noqa: E501 + + self._path = path + + @property + def signer_name(self): + """Gets the signer_name of this V1ClusterTrustBundleProjection. # noqa: E501 + + Select all ClusterTrustBundles that match this signer name. Mutually-exclusive with name. The contents of all selected ClusterTrustBundles will be unified and deduplicated. # noqa: E501 + + :return: The signer_name of this V1ClusterTrustBundleProjection. # noqa: E501 + :rtype: str + """ + return self._signer_name + + @signer_name.setter + def signer_name(self, signer_name): + """Sets the signer_name of this V1ClusterTrustBundleProjection. + + Select all ClusterTrustBundles that match this signer name. Mutually-exclusive with name. The contents of all selected ClusterTrustBundles will be unified and deduplicated. # noqa: E501 + + :param signer_name: The signer_name of this V1ClusterTrustBundleProjection. # noqa: E501 + :type signer_name: str + """ + + self._signer_name = signer_name + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ClusterTrustBundleProjection): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ClusterTrustBundleProjection): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_component_condition.py b/kubernetes_asyncio/client/models/v1_component_condition.py new file mode 100644 index 0000000000..4cfcea0163 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_component_condition.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ComponentCondition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'error': 'str', + 'message': 'str', + 'status': 'str', + 'type': 'str' + } + + attribute_map = { + 'error': 'error', + 'message': 'message', + 'status': 'status', + 'type': 'type' + } + + def __init__(self, error=None, message=None, status=None, type=None, local_vars_configuration=None): # noqa: E501 + """V1ComponentCondition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._error = None + self._message = None + self._status = None + self._type = None + self.discriminator = None + + if error is not None: + self.error = error + if message is not None: + self.message = message + self.status = status + self.type = type + + @property + def error(self): + """Gets the error of this V1ComponentCondition. # noqa: E501 + + Condition error code for a component. For example, a health check error code. # noqa: E501 + + :return: The error of this V1ComponentCondition. # noqa: E501 + :rtype: str + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this V1ComponentCondition. + + Condition error code for a component. For example, a health check error code. # noqa: E501 + + :param error: The error of this V1ComponentCondition. # noqa: E501 + :type error: str + """ + + self._error = error + + @property + def message(self): + """Gets the message of this V1ComponentCondition. # noqa: E501 + + Message about the condition for a component. For example, information about a health check. # noqa: E501 + + :return: The message of this V1ComponentCondition. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this V1ComponentCondition. + + Message about the condition for a component. For example, information about a health check. # noqa: E501 + + :param message: The message of this V1ComponentCondition. # noqa: E501 + :type message: str + """ + + self._message = message + + @property + def status(self): + """Gets the status of this V1ComponentCondition. # noqa: E501 + + Status of the condition for a component. Valid values for \"Healthy\": \"True\", \"False\", or \"Unknown\". # noqa: E501 + + :return: The status of this V1ComponentCondition. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1ComponentCondition. + + Status of the condition for a component. Valid values for \"Healthy\": \"True\", \"False\", or \"Unknown\". # noqa: E501 + + :param status: The status of this V1ComponentCondition. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def type(self): + """Gets the type of this V1ComponentCondition. # noqa: E501 + + Type of condition for a component. Valid value: \"Healthy\" # noqa: E501 + + :return: The type of this V1ComponentCondition. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this V1ComponentCondition. + + Type of condition for a component. Valid value: \"Healthy\" # noqa: E501 + + :param type: The type of this V1ComponentCondition. # noqa: E501 + :type type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ComponentCondition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ComponentCondition): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_component_status.py b/kubernetes_asyncio/client/models/v1_component_status.py new file mode 100644 index 0000000000..9d11a3d79f --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_component_status.py @@ -0,0 +1,215 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ComponentStatus(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'conditions': 'list[V1ComponentCondition]', + 'kind': 'str', + 'metadata': 'V1ObjectMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'conditions': 'conditions', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, conditions=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1ComponentStatus - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._conditions = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if conditions is not None: + self.conditions = conditions + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1ComponentStatus. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1ComponentStatus. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1ComponentStatus. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1ComponentStatus. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def conditions(self): + """Gets the conditions of this V1ComponentStatus. # noqa: E501 + + List of component conditions observed # noqa: E501 + + :return: The conditions of this V1ComponentStatus. # noqa: E501 + :rtype: list[V1ComponentCondition] + """ + return self._conditions + + @conditions.setter + def conditions(self, conditions): + """Sets the conditions of this V1ComponentStatus. + + List of component conditions observed # noqa: E501 + + :param conditions: The conditions of this V1ComponentStatus. # noqa: E501 + :type conditions: list[V1ComponentCondition] + """ + + self._conditions = conditions + + @property + def kind(self): + """Gets the kind of this V1ComponentStatus. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1ComponentStatus. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1ComponentStatus. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1ComponentStatus. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1ComponentStatus. # noqa: E501 + + + :return: The metadata of this V1ComponentStatus. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1ComponentStatus. + + + :param metadata: The metadata of this V1ComponentStatus. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ComponentStatus): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ComponentStatus): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_component_status_list.py b/kubernetes_asyncio/client/models/v1_component_status_list.py new file mode 100644 index 0000000000..2889afd2ff --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_component_status_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ComponentStatusList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1ComponentStatus]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1ComponentStatusList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1ComponentStatusList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1ComponentStatusList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1ComponentStatusList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1ComponentStatusList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1ComponentStatusList. # noqa: E501 + + List of ComponentStatus objects. # noqa: E501 + + :return: The items of this V1ComponentStatusList. # noqa: E501 + :rtype: list[V1ComponentStatus] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1ComponentStatusList. + + List of ComponentStatus objects. # noqa: E501 + + :param items: The items of this V1ComponentStatusList. # noqa: E501 + :type items: list[V1ComponentStatus] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1ComponentStatusList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1ComponentStatusList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1ComponentStatusList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1ComponentStatusList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1ComponentStatusList. # noqa: E501 + + + :return: The metadata of this V1ComponentStatusList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1ComponentStatusList. + + + :param metadata: The metadata of this V1ComponentStatusList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ComponentStatusList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ComponentStatusList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_condition.py b/kubernetes_asyncio/client/models/v1_condition.py new file mode 100644 index 0000000000..2d79c8ecfc --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_condition.py @@ -0,0 +1,278 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1Condition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'last_transition_time': 'datetime', + 'message': 'str', + 'observed_generation': 'int', + 'reason': 'str', + 'status': 'str', + 'type': 'str' + } + + attribute_map = { + 'last_transition_time': 'lastTransitionTime', + 'message': 'message', + 'observed_generation': 'observedGeneration', + 'reason': 'reason', + 'status': 'status', + 'type': 'type' + } + + def __init__(self, last_transition_time=None, message=None, observed_generation=None, reason=None, status=None, type=None, local_vars_configuration=None): # noqa: E501 + """V1Condition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._last_transition_time = None + self._message = None + self._observed_generation = None + self._reason = None + self._status = None + self._type = None + self.discriminator = None + + self.last_transition_time = last_transition_time + self.message = message + if observed_generation is not None: + self.observed_generation = observed_generation + self.reason = reason + self.status = status + self.type = type + + @property + def last_transition_time(self): + """Gets the last_transition_time of this V1Condition. # noqa: E501 + + lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. # noqa: E501 + + :return: The last_transition_time of this V1Condition. # noqa: E501 + :rtype: datetime + """ + return self._last_transition_time + + @last_transition_time.setter + def last_transition_time(self, last_transition_time): + """Sets the last_transition_time of this V1Condition. + + lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. # noqa: E501 + + :param last_transition_time: The last_transition_time of this V1Condition. # noqa: E501 + :type last_transition_time: datetime + """ + if self.local_vars_configuration.client_side_validation and last_transition_time is None: # noqa: E501 + raise ValueError("Invalid value for `last_transition_time`, must not be `None`") # noqa: E501 + + self._last_transition_time = last_transition_time + + @property + def message(self): + """Gets the message of this V1Condition. # noqa: E501 + + message is a human readable message indicating details about the transition. This may be an empty string. # noqa: E501 + + :return: The message of this V1Condition. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this V1Condition. + + message is a human readable message indicating details about the transition. This may be an empty string. # noqa: E501 + + :param message: The message of this V1Condition. # noqa: E501 + :type message: str + """ + if self.local_vars_configuration.client_side_validation and message is None: # noqa: E501 + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def observed_generation(self): + """Gets the observed_generation of this V1Condition. # noqa: E501 + + observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. # noqa: E501 + + :return: The observed_generation of this V1Condition. # noqa: E501 + :rtype: int + """ + return self._observed_generation + + @observed_generation.setter + def observed_generation(self, observed_generation): + """Sets the observed_generation of this V1Condition. + + observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. # noqa: E501 + + :param observed_generation: The observed_generation of this V1Condition. # noqa: E501 + :type observed_generation: int + """ + + self._observed_generation = observed_generation + + @property + def reason(self): + """Gets the reason of this V1Condition. # noqa: E501 + + reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. # noqa: E501 + + :return: The reason of this V1Condition. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this V1Condition. + + reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. # noqa: E501 + + :param reason: The reason of this V1Condition. # noqa: E501 + :type reason: str + """ + if self.local_vars_configuration.client_side_validation and reason is None: # noqa: E501 + raise ValueError("Invalid value for `reason`, must not be `None`") # noqa: E501 + + self._reason = reason + + @property + def status(self): + """Gets the status of this V1Condition. # noqa: E501 + + status of the condition, one of True, False, Unknown. # noqa: E501 + + :return: The status of this V1Condition. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1Condition. + + status of the condition, one of True, False, Unknown. # noqa: E501 + + :param status: The status of this V1Condition. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def type(self): + """Gets the type of this V1Condition. # noqa: E501 + + type of condition in CamelCase or in foo.example.com/CamelCase. # noqa: E501 + + :return: The type of this V1Condition. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this V1Condition. + + type of condition in CamelCase or in foo.example.com/CamelCase. # noqa: E501 + + :param type: The type of this V1Condition. # noqa: E501 + :type type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1Condition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1Condition): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_config_map.py b/kubernetes_asyncio/client/models/v1_config_map.py new file mode 100644 index 0000000000..dbf9c58bba --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_config_map.py @@ -0,0 +1,271 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ConfigMap(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'binary_data': 'dict[str, str]', + 'data': 'dict[str, str]', + 'immutable': 'bool', + 'kind': 'str', + 'metadata': 'V1ObjectMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'binary_data': 'binaryData', + 'data': 'data', + 'immutable': 'immutable', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, binary_data=None, data=None, immutable=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1ConfigMap - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._binary_data = None + self._data = None + self._immutable = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if binary_data is not None: + self.binary_data = binary_data + if data is not None: + self.data = data + if immutable is not None: + self.immutable = immutable + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1ConfigMap. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1ConfigMap. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1ConfigMap. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1ConfigMap. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def binary_data(self): + """Gets the binary_data of this V1ConfigMap. # noqa: E501 + + BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet. # noqa: E501 + + :return: The binary_data of this V1ConfigMap. # noqa: E501 + :rtype: dict[str, str] + """ + return self._binary_data + + @binary_data.setter + def binary_data(self, binary_data): + """Sets the binary_data of this V1ConfigMap. + + BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet. # noqa: E501 + + :param binary_data: The binary_data of this V1ConfigMap. # noqa: E501 + :type binary_data: dict[str, str] + """ + + self._binary_data = binary_data + + @property + def data(self): + """Gets the data of this V1ConfigMap. # noqa: E501 + + Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process. # noqa: E501 + + :return: The data of this V1ConfigMap. # noqa: E501 + :rtype: dict[str, str] + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this V1ConfigMap. + + Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process. # noqa: E501 + + :param data: The data of this V1ConfigMap. # noqa: E501 + :type data: dict[str, str] + """ + + self._data = data + + @property + def immutable(self): + """Gets the immutable of this V1ConfigMap. # noqa: E501 + + Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. # noqa: E501 + + :return: The immutable of this V1ConfigMap. # noqa: E501 + :rtype: bool + """ + return self._immutable + + @immutable.setter + def immutable(self, immutable): + """Sets the immutable of this V1ConfigMap. + + Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. # noqa: E501 + + :param immutable: The immutable of this V1ConfigMap. # noqa: E501 + :type immutable: bool + """ + + self._immutable = immutable + + @property + def kind(self): + """Gets the kind of this V1ConfigMap. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1ConfigMap. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1ConfigMap. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1ConfigMap. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1ConfigMap. # noqa: E501 + + + :return: The metadata of this V1ConfigMap. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1ConfigMap. + + + :param metadata: The metadata of this V1ConfigMap. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ConfigMap): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ConfigMap): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_config_map_env_source.py b/kubernetes_asyncio/client/models/v1_config_map_env_source.py new file mode 100644 index 0000000000..440539d83d --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_config_map_env_source.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ConfigMapEnvSource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'name': 'str', + 'optional': 'bool' + } + + attribute_map = { + 'name': 'name', + 'optional': 'optional' + } + + def __init__(self, name=None, optional=None, local_vars_configuration=None): # noqa: E501 + """V1ConfigMapEnvSource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._name = None + self._optional = None + self.discriminator = None + + if name is not None: + self.name = name + if optional is not None: + self.optional = optional + + @property + def name(self): + """Gets the name of this V1ConfigMapEnvSource. # noqa: E501 + + Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa: E501 + + :return: The name of this V1ConfigMapEnvSource. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1ConfigMapEnvSource. + + Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa: E501 + + :param name: The name of this V1ConfigMapEnvSource. # noqa: E501 + :type name: str + """ + + self._name = name + + @property + def optional(self): + """Gets the optional of this V1ConfigMapEnvSource. # noqa: E501 + + Specify whether the ConfigMap must be defined # noqa: E501 + + :return: The optional of this V1ConfigMapEnvSource. # noqa: E501 + :rtype: bool + """ + return self._optional + + @optional.setter + def optional(self, optional): + """Sets the optional of this V1ConfigMapEnvSource. + + Specify whether the ConfigMap must be defined # noqa: E501 + + :param optional: The optional of this V1ConfigMapEnvSource. # noqa: E501 + :type optional: bool + """ + + self._optional = optional + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ConfigMapEnvSource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ConfigMapEnvSource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_config_map_key_selector.py b/kubernetes_asyncio/client/models/v1_config_map_key_selector.py new file mode 100644 index 0000000000..c4b9123587 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_config_map_key_selector.py @@ -0,0 +1,190 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ConfigMapKeySelector(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'key': 'str', + 'name': 'str', + 'optional': 'bool' + } + + attribute_map = { + 'key': 'key', + 'name': 'name', + 'optional': 'optional' + } + + def __init__(self, key=None, name=None, optional=None, local_vars_configuration=None): # noqa: E501 + """V1ConfigMapKeySelector - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._key = None + self._name = None + self._optional = None + self.discriminator = None + + self.key = key + if name is not None: + self.name = name + if optional is not None: + self.optional = optional + + @property + def key(self): + """Gets the key of this V1ConfigMapKeySelector. # noqa: E501 + + The key to select. # noqa: E501 + + :return: The key of this V1ConfigMapKeySelector. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this V1ConfigMapKeySelector. + + The key to select. # noqa: E501 + + :param key: The key of this V1ConfigMapKeySelector. # noqa: E501 + :type key: str + """ + if self.local_vars_configuration.client_side_validation and key is None: # noqa: E501 + raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501 + + self._key = key + + @property + def name(self): + """Gets the name of this V1ConfigMapKeySelector. # noqa: E501 + + Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa: E501 + + :return: The name of this V1ConfigMapKeySelector. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1ConfigMapKeySelector. + + Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa: E501 + + :param name: The name of this V1ConfigMapKeySelector. # noqa: E501 + :type name: str + """ + + self._name = name + + @property + def optional(self): + """Gets the optional of this V1ConfigMapKeySelector. # noqa: E501 + + Specify whether the ConfigMap or its key must be defined # noqa: E501 + + :return: The optional of this V1ConfigMapKeySelector. # noqa: E501 + :rtype: bool + """ + return self._optional + + @optional.setter + def optional(self, optional): + """Sets the optional of this V1ConfigMapKeySelector. + + Specify whether the ConfigMap or its key must be defined # noqa: E501 + + :param optional: The optional of this V1ConfigMapKeySelector. # noqa: E501 + :type optional: bool + """ + + self._optional = optional + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ConfigMapKeySelector): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ConfigMapKeySelector): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_config_map_list.py b/kubernetes_asyncio/client/models/v1_config_map_list.py new file mode 100644 index 0000000000..d188a36c41 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_config_map_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ConfigMapList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1ConfigMap]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1ConfigMapList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1ConfigMapList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1ConfigMapList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1ConfigMapList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1ConfigMapList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1ConfigMapList. # noqa: E501 + + Items is the list of ConfigMaps. # noqa: E501 + + :return: The items of this V1ConfigMapList. # noqa: E501 + :rtype: list[V1ConfigMap] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1ConfigMapList. + + Items is the list of ConfigMaps. # noqa: E501 + + :param items: The items of this V1ConfigMapList. # noqa: E501 + :type items: list[V1ConfigMap] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1ConfigMapList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1ConfigMapList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1ConfigMapList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1ConfigMapList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1ConfigMapList. # noqa: E501 + + + :return: The metadata of this V1ConfigMapList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1ConfigMapList. + + + :param metadata: The metadata of this V1ConfigMapList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ConfigMapList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ConfigMapList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_config_map_node_config_source.py b/kubernetes_asyncio/client/models/v1_config_map_node_config_source.py new file mode 100644 index 0000000000..acef6bc3cc --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_config_map_node_config_source.py @@ -0,0 +1,248 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ConfigMapNodeConfigSource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'kubelet_config_key': 'str', + 'name': 'str', + 'namespace': 'str', + 'resource_version': 'str', + 'uid': 'str' + } + + attribute_map = { + 'kubelet_config_key': 'kubeletConfigKey', + 'name': 'name', + 'namespace': 'namespace', + 'resource_version': 'resourceVersion', + 'uid': 'uid' + } + + def __init__(self, kubelet_config_key=None, name=None, namespace=None, resource_version=None, uid=None, local_vars_configuration=None): # noqa: E501 + """V1ConfigMapNodeConfigSource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._kubelet_config_key = None + self._name = None + self._namespace = None + self._resource_version = None + self._uid = None + self.discriminator = None + + self.kubelet_config_key = kubelet_config_key + self.name = name + self.namespace = namespace + if resource_version is not None: + self.resource_version = resource_version + if uid is not None: + self.uid = uid + + @property + def kubelet_config_key(self): + """Gets the kubelet_config_key of this V1ConfigMapNodeConfigSource. # noqa: E501 + + KubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure This field is required in all cases. # noqa: E501 + + :return: The kubelet_config_key of this V1ConfigMapNodeConfigSource. # noqa: E501 + :rtype: str + """ + return self._kubelet_config_key + + @kubelet_config_key.setter + def kubelet_config_key(self, kubelet_config_key): + """Sets the kubelet_config_key of this V1ConfigMapNodeConfigSource. + + KubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure This field is required in all cases. # noqa: E501 + + :param kubelet_config_key: The kubelet_config_key of this V1ConfigMapNodeConfigSource. # noqa: E501 + :type kubelet_config_key: str + """ + if self.local_vars_configuration.client_side_validation and kubelet_config_key is None: # noqa: E501 + raise ValueError("Invalid value for `kubelet_config_key`, must not be `None`") # noqa: E501 + + self._kubelet_config_key = kubelet_config_key + + @property + def name(self): + """Gets the name of this V1ConfigMapNodeConfigSource. # noqa: E501 + + Name is the metadata.name of the referenced ConfigMap. This field is required in all cases. # noqa: E501 + + :return: The name of this V1ConfigMapNodeConfigSource. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1ConfigMapNodeConfigSource. + + Name is the metadata.name of the referenced ConfigMap. This field is required in all cases. # noqa: E501 + + :param name: The name of this V1ConfigMapNodeConfigSource. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def namespace(self): + """Gets the namespace of this V1ConfigMapNodeConfigSource. # noqa: E501 + + Namespace is the metadata.namespace of the referenced ConfigMap. This field is required in all cases. # noqa: E501 + + :return: The namespace of this V1ConfigMapNodeConfigSource. # noqa: E501 + :rtype: str + """ + return self._namespace + + @namespace.setter + def namespace(self, namespace): + """Sets the namespace of this V1ConfigMapNodeConfigSource. + + Namespace is the metadata.namespace of the referenced ConfigMap. This field is required in all cases. # noqa: E501 + + :param namespace: The namespace of this V1ConfigMapNodeConfigSource. # noqa: E501 + :type namespace: str + """ + if self.local_vars_configuration.client_side_validation and namespace is None: # noqa: E501 + raise ValueError("Invalid value for `namespace`, must not be `None`") # noqa: E501 + + self._namespace = namespace + + @property + def resource_version(self): + """Gets the resource_version of this V1ConfigMapNodeConfigSource. # noqa: E501 + + ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status. # noqa: E501 + + :return: The resource_version of this V1ConfigMapNodeConfigSource. # noqa: E501 + :rtype: str + """ + return self._resource_version + + @resource_version.setter + def resource_version(self, resource_version): + """Sets the resource_version of this V1ConfigMapNodeConfigSource. + + ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status. # noqa: E501 + + :param resource_version: The resource_version of this V1ConfigMapNodeConfigSource. # noqa: E501 + :type resource_version: str + """ + + self._resource_version = resource_version + + @property + def uid(self): + """Gets the uid of this V1ConfigMapNodeConfigSource. # noqa: E501 + + UID is the metadata.UID of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status. # noqa: E501 + + :return: The uid of this V1ConfigMapNodeConfigSource. # noqa: E501 + :rtype: str + """ + return self._uid + + @uid.setter + def uid(self, uid): + """Sets the uid of this V1ConfigMapNodeConfigSource. + + UID is the metadata.UID of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status. # noqa: E501 + + :param uid: The uid of this V1ConfigMapNodeConfigSource. # noqa: E501 + :type uid: str + """ + + self._uid = uid + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ConfigMapNodeConfigSource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ConfigMapNodeConfigSource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_config_map_projection.py b/kubernetes_asyncio/client/models/v1_config_map_projection.py new file mode 100644 index 0000000000..55d4eac91c --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_config_map_projection.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ConfigMapProjection(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'items': 'list[V1KeyToPath]', + 'name': 'str', + 'optional': 'bool' + } + + attribute_map = { + 'items': 'items', + 'name': 'name', + 'optional': 'optional' + } + + def __init__(self, items=None, name=None, optional=None, local_vars_configuration=None): # noqa: E501 + """V1ConfigMapProjection - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._items = None + self._name = None + self._optional = None + self.discriminator = None + + if items is not None: + self.items = items + if name is not None: + self.name = name + if optional is not None: + self.optional = optional + + @property + def items(self): + """Gets the items of this V1ConfigMapProjection. # noqa: E501 + + items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. # noqa: E501 + + :return: The items of this V1ConfigMapProjection. # noqa: E501 + :rtype: list[V1KeyToPath] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1ConfigMapProjection. + + items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. # noqa: E501 + + :param items: The items of this V1ConfigMapProjection. # noqa: E501 + :type items: list[V1KeyToPath] + """ + + self._items = items + + @property + def name(self): + """Gets the name of this V1ConfigMapProjection. # noqa: E501 + + Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa: E501 + + :return: The name of this V1ConfigMapProjection. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1ConfigMapProjection. + + Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa: E501 + + :param name: The name of this V1ConfigMapProjection. # noqa: E501 + :type name: str + """ + + self._name = name + + @property + def optional(self): + """Gets the optional of this V1ConfigMapProjection. # noqa: E501 + + optional specify whether the ConfigMap or its keys must be defined # noqa: E501 + + :return: The optional of this V1ConfigMapProjection. # noqa: E501 + :rtype: bool + """ + return self._optional + + @optional.setter + def optional(self, optional): + """Sets the optional of this V1ConfigMapProjection. + + optional specify whether the ConfigMap or its keys must be defined # noqa: E501 + + :param optional: The optional of this V1ConfigMapProjection. # noqa: E501 + :type optional: bool + """ + + self._optional = optional + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ConfigMapProjection): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ConfigMapProjection): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_config_map_volume_source.py b/kubernetes_asyncio/client/models/v1_config_map_volume_source.py new file mode 100644 index 0000000000..567716a4a9 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_config_map_volume_source.py @@ -0,0 +1,217 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ConfigMapVolumeSource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'default_mode': 'int', + 'items': 'list[V1KeyToPath]', + 'name': 'str', + 'optional': 'bool' + } + + attribute_map = { + 'default_mode': 'defaultMode', + 'items': 'items', + 'name': 'name', + 'optional': 'optional' + } + + def __init__(self, default_mode=None, items=None, name=None, optional=None, local_vars_configuration=None): # noqa: E501 + """V1ConfigMapVolumeSource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._default_mode = None + self._items = None + self._name = None + self._optional = None + self.discriminator = None + + if default_mode is not None: + self.default_mode = default_mode + if items is not None: + self.items = items + if name is not None: + self.name = name + if optional is not None: + self.optional = optional + + @property + def default_mode(self): + """Gets the default_mode of this V1ConfigMapVolumeSource. # noqa: E501 + + defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. # noqa: E501 + + :return: The default_mode of this V1ConfigMapVolumeSource. # noqa: E501 + :rtype: int + """ + return self._default_mode + + @default_mode.setter + def default_mode(self, default_mode): + """Sets the default_mode of this V1ConfigMapVolumeSource. + + defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. # noqa: E501 + + :param default_mode: The default_mode of this V1ConfigMapVolumeSource. # noqa: E501 + :type default_mode: int + """ + + self._default_mode = default_mode + + @property + def items(self): + """Gets the items of this V1ConfigMapVolumeSource. # noqa: E501 + + items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. # noqa: E501 + + :return: The items of this V1ConfigMapVolumeSource. # noqa: E501 + :rtype: list[V1KeyToPath] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1ConfigMapVolumeSource. + + items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. # noqa: E501 + + :param items: The items of this V1ConfigMapVolumeSource. # noqa: E501 + :type items: list[V1KeyToPath] + """ + + self._items = items + + @property + def name(self): + """Gets the name of this V1ConfigMapVolumeSource. # noqa: E501 + + Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa: E501 + + :return: The name of this V1ConfigMapVolumeSource. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1ConfigMapVolumeSource. + + Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa: E501 + + :param name: The name of this V1ConfigMapVolumeSource. # noqa: E501 + :type name: str + """ + + self._name = name + + @property + def optional(self): + """Gets the optional of this V1ConfigMapVolumeSource. # noqa: E501 + + optional specify whether the ConfigMap or its keys must be defined # noqa: E501 + + :return: The optional of this V1ConfigMapVolumeSource. # noqa: E501 + :rtype: bool + """ + return self._optional + + @optional.setter + def optional(self, optional): + """Sets the optional of this V1ConfigMapVolumeSource. + + optional specify whether the ConfigMap or its keys must be defined # noqa: E501 + + :param optional: The optional of this V1ConfigMapVolumeSource. # noqa: E501 + :type optional: bool + """ + + self._optional = optional + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ConfigMapVolumeSource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ConfigMapVolumeSource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_container.py b/kubernetes_asyncio/client/models/v1_container.py new file mode 100644 index 0000000000..bc6c54de30 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_container.py @@ -0,0 +1,794 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1Container(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'args': 'list[str]', + 'command': 'list[str]', + 'env': 'list[V1EnvVar]', + 'env_from': 'list[V1EnvFromSource]', + 'image': 'str', + 'image_pull_policy': 'str', + 'lifecycle': 'V1Lifecycle', + 'liveness_probe': 'V1Probe', + 'name': 'str', + 'ports': 'list[V1ContainerPort]', + 'readiness_probe': 'V1Probe', + 'resize_policy': 'list[V1ContainerResizePolicy]', + 'resources': 'V1ResourceRequirements', + 'restart_policy': 'str', + 'restart_policy_rules': 'list[V1ContainerRestartRule]', + 'security_context': 'V1SecurityContext', + 'startup_probe': 'V1Probe', + 'stdin': 'bool', + 'stdin_once': 'bool', + 'termination_message_path': 'str', + 'termination_message_policy': 'str', + 'tty': 'bool', + 'volume_devices': 'list[V1VolumeDevice]', + 'volume_mounts': 'list[V1VolumeMount]', + 'working_dir': 'str' + } + + attribute_map = { + 'args': 'args', + 'command': 'command', + 'env': 'env', + 'env_from': 'envFrom', + 'image': 'image', + 'image_pull_policy': 'imagePullPolicy', + 'lifecycle': 'lifecycle', + 'liveness_probe': 'livenessProbe', + 'name': 'name', + 'ports': 'ports', + 'readiness_probe': 'readinessProbe', + 'resize_policy': 'resizePolicy', + 'resources': 'resources', + 'restart_policy': 'restartPolicy', + 'restart_policy_rules': 'restartPolicyRules', + 'security_context': 'securityContext', + 'startup_probe': 'startupProbe', + 'stdin': 'stdin', + 'stdin_once': 'stdinOnce', + 'termination_message_path': 'terminationMessagePath', + 'termination_message_policy': 'terminationMessagePolicy', + 'tty': 'tty', + 'volume_devices': 'volumeDevices', + 'volume_mounts': 'volumeMounts', + 'working_dir': 'workingDir' + } + + def __init__(self, args=None, command=None, env=None, env_from=None, image=None, image_pull_policy=None, lifecycle=None, liveness_probe=None, name=None, ports=None, readiness_probe=None, resize_policy=None, resources=None, restart_policy=None, restart_policy_rules=None, security_context=None, startup_probe=None, stdin=None, stdin_once=None, termination_message_path=None, termination_message_policy=None, tty=None, volume_devices=None, volume_mounts=None, working_dir=None, local_vars_configuration=None): # noqa: E501 + """V1Container - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._args = None + self._command = None + self._env = None + self._env_from = None + self._image = None + self._image_pull_policy = None + self._lifecycle = None + self._liveness_probe = None + self._name = None + self._ports = None + self._readiness_probe = None + self._resize_policy = None + self._resources = None + self._restart_policy = None + self._restart_policy_rules = None + self._security_context = None + self._startup_probe = None + self._stdin = None + self._stdin_once = None + self._termination_message_path = None + self._termination_message_policy = None + self._tty = None + self._volume_devices = None + self._volume_mounts = None + self._working_dir = None + self.discriminator = None + + if args is not None: + self.args = args + if command is not None: + self.command = command + if env is not None: + self.env = env + if env_from is not None: + self.env_from = env_from + if image is not None: + self.image = image + if image_pull_policy is not None: + self.image_pull_policy = image_pull_policy + if lifecycle is not None: + self.lifecycle = lifecycle + if liveness_probe is not None: + self.liveness_probe = liveness_probe + self.name = name + if ports is not None: + self.ports = ports + if readiness_probe is not None: + self.readiness_probe = readiness_probe + if resize_policy is not None: + self.resize_policy = resize_policy + if resources is not None: + self.resources = resources + if restart_policy is not None: + self.restart_policy = restart_policy + if restart_policy_rules is not None: + self.restart_policy_rules = restart_policy_rules + if security_context is not None: + self.security_context = security_context + if startup_probe is not None: + self.startup_probe = startup_probe + if stdin is not None: + self.stdin = stdin + if stdin_once is not None: + self.stdin_once = stdin_once + if termination_message_path is not None: + self.termination_message_path = termination_message_path + if termination_message_policy is not None: + self.termination_message_policy = termination_message_policy + if tty is not None: + self.tty = tty + if volume_devices is not None: + self.volume_devices = volume_devices + if volume_mounts is not None: + self.volume_mounts = volume_mounts + if working_dir is not None: + self.working_dir = working_dir + + @property + def args(self): + """Gets the args of this V1Container. # noqa: E501 + + Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell # noqa: E501 + + :return: The args of this V1Container. # noqa: E501 + :rtype: list[str] + """ + return self._args + + @args.setter + def args(self, args): + """Sets the args of this V1Container. + + Arguments to the entrypoint. The container image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell # noqa: E501 + + :param args: The args of this V1Container. # noqa: E501 + :type args: list[str] + """ + + self._args = args + + @property + def command(self): + """Gets the command of this V1Container. # noqa: E501 + + Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell # noqa: E501 + + :return: The command of this V1Container. # noqa: E501 + :rtype: list[str] + """ + return self._command + + @command.setter + def command(self, command): + """Sets the command of this V1Container. + + Entrypoint array. Not executed within a shell. The container image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell # noqa: E501 + + :param command: The command of this V1Container. # noqa: E501 + :type command: list[str] + """ + + self._command = command + + @property + def env(self): + """Gets the env of this V1Container. # noqa: E501 + + List of environment variables to set in the container. Cannot be updated. # noqa: E501 + + :return: The env of this V1Container. # noqa: E501 + :rtype: list[V1EnvVar] + """ + return self._env + + @env.setter + def env(self, env): + """Sets the env of this V1Container. + + List of environment variables to set in the container. Cannot be updated. # noqa: E501 + + :param env: The env of this V1Container. # noqa: E501 + :type env: list[V1EnvVar] + """ + + self._env = env + + @property + def env_from(self): + """Gets the env_from of this V1Container. # noqa: E501 + + List of sources to populate environment variables in the container. The keys defined within a source may consist of any printable ASCII characters except '='. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. # noqa: E501 + + :return: The env_from of this V1Container. # noqa: E501 + :rtype: list[V1EnvFromSource] + """ + return self._env_from + + @env_from.setter + def env_from(self, env_from): + """Sets the env_from of this V1Container. + + List of sources to populate environment variables in the container. The keys defined within a source may consist of any printable ASCII characters except '='. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. # noqa: E501 + + :param env_from: The env_from of this V1Container. # noqa: E501 + :type env_from: list[V1EnvFromSource] + """ + + self._env_from = env_from + + @property + def image(self): + """Gets the image of this V1Container. # noqa: E501 + + Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets. # noqa: E501 + + :return: The image of this V1Container. # noqa: E501 + :rtype: str + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this V1Container. + + Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets. # noqa: E501 + + :param image: The image of this V1Container. # noqa: E501 + :type image: str + """ + + self._image = image + + @property + def image_pull_policy(self): + """Gets the image_pull_policy of this V1Container. # noqa: E501 + + Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images # noqa: E501 + + :return: The image_pull_policy of this V1Container. # noqa: E501 + :rtype: str + """ + return self._image_pull_policy + + @image_pull_policy.setter + def image_pull_policy(self, image_pull_policy): + """Sets the image_pull_policy of this V1Container. + + Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images # noqa: E501 + + :param image_pull_policy: The image_pull_policy of this V1Container. # noqa: E501 + :type image_pull_policy: str + """ + + self._image_pull_policy = image_pull_policy + + @property + def lifecycle(self): + """Gets the lifecycle of this V1Container. # noqa: E501 + + + :return: The lifecycle of this V1Container. # noqa: E501 + :rtype: V1Lifecycle + """ + return self._lifecycle + + @lifecycle.setter + def lifecycle(self, lifecycle): + """Sets the lifecycle of this V1Container. + + + :param lifecycle: The lifecycle of this V1Container. # noqa: E501 + :type lifecycle: V1Lifecycle + """ + + self._lifecycle = lifecycle + + @property + def liveness_probe(self): + """Gets the liveness_probe of this V1Container. # noqa: E501 + + + :return: The liveness_probe of this V1Container. # noqa: E501 + :rtype: V1Probe + """ + return self._liveness_probe + + @liveness_probe.setter + def liveness_probe(self, liveness_probe): + """Sets the liveness_probe of this V1Container. + + + :param liveness_probe: The liveness_probe of this V1Container. # noqa: E501 + :type liveness_probe: V1Probe + """ + + self._liveness_probe = liveness_probe + + @property + def name(self): + """Gets the name of this V1Container. # noqa: E501 + + Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. # noqa: E501 + + :return: The name of this V1Container. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1Container. + + Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. # noqa: E501 + + :param name: The name of this V1Container. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def ports(self): + """Gets the ports of this V1Container. # noqa: E501 + + List of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Modifying this array with strategic merge patch may corrupt the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated. # noqa: E501 + + :return: The ports of this V1Container. # noqa: E501 + :rtype: list[V1ContainerPort] + """ + return self._ports + + @ports.setter + def ports(self, ports): + """Sets the ports of this V1Container. + + List of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Modifying this array with strategic merge patch may corrupt the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated. # noqa: E501 + + :param ports: The ports of this V1Container. # noqa: E501 + :type ports: list[V1ContainerPort] + """ + + self._ports = ports + + @property + def readiness_probe(self): + """Gets the readiness_probe of this V1Container. # noqa: E501 + + + :return: The readiness_probe of this V1Container. # noqa: E501 + :rtype: V1Probe + """ + return self._readiness_probe + + @readiness_probe.setter + def readiness_probe(self, readiness_probe): + """Sets the readiness_probe of this V1Container. + + + :param readiness_probe: The readiness_probe of this V1Container. # noqa: E501 + :type readiness_probe: V1Probe + """ + + self._readiness_probe = readiness_probe + + @property + def resize_policy(self): + """Gets the resize_policy of this V1Container. # noqa: E501 + + Resources resize policy for the container. This field cannot be set on ephemeral containers. # noqa: E501 + + :return: The resize_policy of this V1Container. # noqa: E501 + :rtype: list[V1ContainerResizePolicy] + """ + return self._resize_policy + + @resize_policy.setter + def resize_policy(self, resize_policy): + """Sets the resize_policy of this V1Container. + + Resources resize policy for the container. This field cannot be set on ephemeral containers. # noqa: E501 + + :param resize_policy: The resize_policy of this V1Container. # noqa: E501 + :type resize_policy: list[V1ContainerResizePolicy] + """ + + self._resize_policy = resize_policy + + @property + def resources(self): + """Gets the resources of this V1Container. # noqa: E501 + + + :return: The resources of this V1Container. # noqa: E501 + :rtype: V1ResourceRequirements + """ + return self._resources + + @resources.setter + def resources(self, resources): + """Sets the resources of this V1Container. + + + :param resources: The resources of this V1Container. # noqa: E501 + :type resources: V1ResourceRequirements + """ + + self._resources = resources + + @property + def restart_policy(self): + """Gets the restart_policy of this V1Container. # noqa: E501 + + RestartPolicy defines the restart behavior of individual containers in a pod. This overrides the pod-level restart policy. When this field is not specified, the restart behavior is defined by the Pod's restart policy and the container type. Additionally, setting the RestartPolicy as \"Always\" for the init container will have the following effect: this init container will be continually restarted on exit until all regular containers have terminated. Once all regular containers have completed, all init containers with restartPolicy \"Always\" will be shut down. This lifecycle differs from normal init containers and is often referred to as a \"sidecar\" container. Although this init container still starts in the init container sequence, it does not wait for the container to complete before proceeding to the next init container. Instead, the next init container starts immediately after this init container is started, or after any startupProbe has successfully completed. # noqa: E501 + + :return: The restart_policy of this V1Container. # noqa: E501 + :rtype: str + """ + return self._restart_policy + + @restart_policy.setter + def restart_policy(self, restart_policy): + """Sets the restart_policy of this V1Container. + + RestartPolicy defines the restart behavior of individual containers in a pod. This overrides the pod-level restart policy. When this field is not specified, the restart behavior is defined by the Pod's restart policy and the container type. Additionally, setting the RestartPolicy as \"Always\" for the init container will have the following effect: this init container will be continually restarted on exit until all regular containers have terminated. Once all regular containers have completed, all init containers with restartPolicy \"Always\" will be shut down. This lifecycle differs from normal init containers and is often referred to as a \"sidecar\" container. Although this init container still starts in the init container sequence, it does not wait for the container to complete before proceeding to the next init container. Instead, the next init container starts immediately after this init container is started, or after any startupProbe has successfully completed. # noqa: E501 + + :param restart_policy: The restart_policy of this V1Container. # noqa: E501 + :type restart_policy: str + """ + + self._restart_policy = restart_policy + + @property + def restart_policy_rules(self): + """Gets the restart_policy_rules of this V1Container. # noqa: E501 + + Represents a list of rules to be checked to determine if the container should be restarted on exit. The rules are evaluated in order. Once a rule matches a container exit condition, the remaining rules are ignored. If no rule matches the container exit condition, the Container-level restart policy determines the whether the container is restarted or not. Constraints on the rules: - At most 20 rules are allowed. - Rules can have the same action. - Identical rules are not forbidden in validations. When rules are specified, container MUST set RestartPolicy explicitly even it if matches the Pod's RestartPolicy. # noqa: E501 + + :return: The restart_policy_rules of this V1Container. # noqa: E501 + :rtype: list[V1ContainerRestartRule] + """ + return self._restart_policy_rules + + @restart_policy_rules.setter + def restart_policy_rules(self, restart_policy_rules): + """Sets the restart_policy_rules of this V1Container. + + Represents a list of rules to be checked to determine if the container should be restarted on exit. The rules are evaluated in order. Once a rule matches a container exit condition, the remaining rules are ignored. If no rule matches the container exit condition, the Container-level restart policy determines the whether the container is restarted or not. Constraints on the rules: - At most 20 rules are allowed. - Rules can have the same action. - Identical rules are not forbidden in validations. When rules are specified, container MUST set RestartPolicy explicitly even it if matches the Pod's RestartPolicy. # noqa: E501 + + :param restart_policy_rules: The restart_policy_rules of this V1Container. # noqa: E501 + :type restart_policy_rules: list[V1ContainerRestartRule] + """ + + self._restart_policy_rules = restart_policy_rules + + @property + def security_context(self): + """Gets the security_context of this V1Container. # noqa: E501 + + + :return: The security_context of this V1Container. # noqa: E501 + :rtype: V1SecurityContext + """ + return self._security_context + + @security_context.setter + def security_context(self, security_context): + """Sets the security_context of this V1Container. + + + :param security_context: The security_context of this V1Container. # noqa: E501 + :type security_context: V1SecurityContext + """ + + self._security_context = security_context + + @property + def startup_probe(self): + """Gets the startup_probe of this V1Container. # noqa: E501 + + + :return: The startup_probe of this V1Container. # noqa: E501 + :rtype: V1Probe + """ + return self._startup_probe + + @startup_probe.setter + def startup_probe(self, startup_probe): + """Sets the startup_probe of this V1Container. + + + :param startup_probe: The startup_probe of this V1Container. # noqa: E501 + :type startup_probe: V1Probe + """ + + self._startup_probe = startup_probe + + @property + def stdin(self): + """Gets the stdin of this V1Container. # noqa: E501 + + Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. # noqa: E501 + + :return: The stdin of this V1Container. # noqa: E501 + :rtype: bool + """ + return self._stdin + + @stdin.setter + def stdin(self, stdin): + """Sets the stdin of this V1Container. + + Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. # noqa: E501 + + :param stdin: The stdin of this V1Container. # noqa: E501 + :type stdin: bool + """ + + self._stdin = stdin + + @property + def stdin_once(self): + """Gets the stdin_once of this V1Container. # noqa: E501 + + Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false # noqa: E501 + + :return: The stdin_once of this V1Container. # noqa: E501 + :rtype: bool + """ + return self._stdin_once + + @stdin_once.setter + def stdin_once(self, stdin_once): + """Sets the stdin_once of this V1Container. + + Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false # noqa: E501 + + :param stdin_once: The stdin_once of this V1Container. # noqa: E501 + :type stdin_once: bool + """ + + self._stdin_once = stdin_once + + @property + def termination_message_path(self): + """Gets the termination_message_path of this V1Container. # noqa: E501 + + Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated. # noqa: E501 + + :return: The termination_message_path of this V1Container. # noqa: E501 + :rtype: str + """ + return self._termination_message_path + + @termination_message_path.setter + def termination_message_path(self, termination_message_path): + """Sets the termination_message_path of this V1Container. + + Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated. # noqa: E501 + + :param termination_message_path: The termination_message_path of this V1Container. # noqa: E501 + :type termination_message_path: str + """ + + self._termination_message_path = termination_message_path + + @property + def termination_message_policy(self): + """Gets the termination_message_policy of this V1Container. # noqa: E501 + + Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. # noqa: E501 + + :return: The termination_message_policy of this V1Container. # noqa: E501 + :rtype: str + """ + return self._termination_message_policy + + @termination_message_policy.setter + def termination_message_policy(self, termination_message_policy): + """Sets the termination_message_policy of this V1Container. + + Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. # noqa: E501 + + :param termination_message_policy: The termination_message_policy of this V1Container. # noqa: E501 + :type termination_message_policy: str + """ + + self._termination_message_policy = termination_message_policy + + @property + def tty(self): + """Gets the tty of this V1Container. # noqa: E501 + + Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. # noqa: E501 + + :return: The tty of this V1Container. # noqa: E501 + :rtype: bool + """ + return self._tty + + @tty.setter + def tty(self, tty): + """Sets the tty of this V1Container. + + Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. # noqa: E501 + + :param tty: The tty of this V1Container. # noqa: E501 + :type tty: bool + """ + + self._tty = tty + + @property + def volume_devices(self): + """Gets the volume_devices of this V1Container. # noqa: E501 + + volumeDevices is the list of block devices to be used by the container. # noqa: E501 + + :return: The volume_devices of this V1Container. # noqa: E501 + :rtype: list[V1VolumeDevice] + """ + return self._volume_devices + + @volume_devices.setter + def volume_devices(self, volume_devices): + """Sets the volume_devices of this V1Container. + + volumeDevices is the list of block devices to be used by the container. # noqa: E501 + + :param volume_devices: The volume_devices of this V1Container. # noqa: E501 + :type volume_devices: list[V1VolumeDevice] + """ + + self._volume_devices = volume_devices + + @property + def volume_mounts(self): + """Gets the volume_mounts of this V1Container. # noqa: E501 + + Pod volumes to mount into the container's filesystem. Cannot be updated. # noqa: E501 + + :return: The volume_mounts of this V1Container. # noqa: E501 + :rtype: list[V1VolumeMount] + """ + return self._volume_mounts + + @volume_mounts.setter + def volume_mounts(self, volume_mounts): + """Sets the volume_mounts of this V1Container. + + Pod volumes to mount into the container's filesystem. Cannot be updated. # noqa: E501 + + :param volume_mounts: The volume_mounts of this V1Container. # noqa: E501 + :type volume_mounts: list[V1VolumeMount] + """ + + self._volume_mounts = volume_mounts + + @property + def working_dir(self): + """Gets the working_dir of this V1Container. # noqa: E501 + + Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. # noqa: E501 + + :return: The working_dir of this V1Container. # noqa: E501 + :rtype: str + """ + return self._working_dir + + @working_dir.setter + def working_dir(self, working_dir): + """Sets the working_dir of this V1Container. + + Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. # noqa: E501 + + :param working_dir: The working_dir of this V1Container. # noqa: E501 + :type working_dir: str + """ + + self._working_dir = working_dir + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1Container): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1Container): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_container_extended_resource_request.py b/kubernetes_asyncio/client/models/v1_container_extended_resource_request.py new file mode 100644 index 0000000000..f727b04d44 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_container_extended_resource_request.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ContainerExtendedResourceRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'container_name': 'str', + 'request_name': 'str', + 'resource_name': 'str' + } + + attribute_map = { + 'container_name': 'containerName', + 'request_name': 'requestName', + 'resource_name': 'resourceName' + } + + def __init__(self, container_name=None, request_name=None, resource_name=None, local_vars_configuration=None): # noqa: E501 + """V1ContainerExtendedResourceRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._container_name = None + self._request_name = None + self._resource_name = None + self.discriminator = None + + self.container_name = container_name + self.request_name = request_name + self.resource_name = resource_name + + @property + def container_name(self): + """Gets the container_name of this V1ContainerExtendedResourceRequest. # noqa: E501 + + The name of the container requesting resources. # noqa: E501 + + :return: The container_name of this V1ContainerExtendedResourceRequest. # noqa: E501 + :rtype: str + """ + return self._container_name + + @container_name.setter + def container_name(self, container_name): + """Sets the container_name of this V1ContainerExtendedResourceRequest. + + The name of the container requesting resources. # noqa: E501 + + :param container_name: The container_name of this V1ContainerExtendedResourceRequest. # noqa: E501 + :type container_name: str + """ + if self.local_vars_configuration.client_side_validation and container_name is None: # noqa: E501 + raise ValueError("Invalid value for `container_name`, must not be `None`") # noqa: E501 + + self._container_name = container_name + + @property + def request_name(self): + """Gets the request_name of this V1ContainerExtendedResourceRequest. # noqa: E501 + + The name of the request in the special ResourceClaim which corresponds to the extended resource. # noqa: E501 + + :return: The request_name of this V1ContainerExtendedResourceRequest. # noqa: E501 + :rtype: str + """ + return self._request_name + + @request_name.setter + def request_name(self, request_name): + """Sets the request_name of this V1ContainerExtendedResourceRequest. + + The name of the request in the special ResourceClaim which corresponds to the extended resource. # noqa: E501 + + :param request_name: The request_name of this V1ContainerExtendedResourceRequest. # noqa: E501 + :type request_name: str + """ + if self.local_vars_configuration.client_side_validation and request_name is None: # noqa: E501 + raise ValueError("Invalid value for `request_name`, must not be `None`") # noqa: E501 + + self._request_name = request_name + + @property + def resource_name(self): + """Gets the resource_name of this V1ContainerExtendedResourceRequest. # noqa: E501 + + The name of the extended resource in that container which gets backed by DRA. # noqa: E501 + + :return: The resource_name of this V1ContainerExtendedResourceRequest. # noqa: E501 + :rtype: str + """ + return self._resource_name + + @resource_name.setter + def resource_name(self, resource_name): + """Sets the resource_name of this V1ContainerExtendedResourceRequest. + + The name of the extended resource in that container which gets backed by DRA. # noqa: E501 + + :param resource_name: The resource_name of this V1ContainerExtendedResourceRequest. # noqa: E501 + :type resource_name: str + """ + if self.local_vars_configuration.client_side_validation and resource_name is None: # noqa: E501 + raise ValueError("Invalid value for `resource_name`, must not be `None`") # noqa: E501 + + self._resource_name = resource_name + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ContainerExtendedResourceRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ContainerExtendedResourceRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_container_image.py b/kubernetes_asyncio/client/models/v1_container_image.py new file mode 100644 index 0000000000..8e23b959ba --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_container_image.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ContainerImage(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'names': 'list[str]', + 'size_bytes': 'int' + } + + attribute_map = { + 'names': 'names', + 'size_bytes': 'sizeBytes' + } + + def __init__(self, names=None, size_bytes=None, local_vars_configuration=None): # noqa: E501 + """V1ContainerImage - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._names = None + self._size_bytes = None + self.discriminator = None + + if names is not None: + self.names = names + if size_bytes is not None: + self.size_bytes = size_bytes + + @property + def names(self): + """Gets the names of this V1ContainerImage. # noqa: E501 + + Names by which this image is known. e.g. [\"kubernetes.example/hyperkube:v1.0.7\", \"cloud-vendor.registry.example/cloud-vendor/hyperkube:v1.0.7\"] # noqa: E501 + + :return: The names of this V1ContainerImage. # noqa: E501 + :rtype: list[str] + """ + return self._names + + @names.setter + def names(self, names): + """Sets the names of this V1ContainerImage. + + Names by which this image is known. e.g. [\"kubernetes.example/hyperkube:v1.0.7\", \"cloud-vendor.registry.example/cloud-vendor/hyperkube:v1.0.7\"] # noqa: E501 + + :param names: The names of this V1ContainerImage. # noqa: E501 + :type names: list[str] + """ + + self._names = names + + @property + def size_bytes(self): + """Gets the size_bytes of this V1ContainerImage. # noqa: E501 + + The size of the image in bytes. # noqa: E501 + + :return: The size_bytes of this V1ContainerImage. # noqa: E501 + :rtype: int + """ + return self._size_bytes + + @size_bytes.setter + def size_bytes(self, size_bytes): + """Sets the size_bytes of this V1ContainerImage. + + The size of the image in bytes. # noqa: E501 + + :param size_bytes: The size_bytes of this V1ContainerImage. # noqa: E501 + :type size_bytes: int + """ + + self._size_bytes = size_bytes + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ContainerImage): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ContainerImage): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_container_port.py b/kubernetes_asyncio/client/models/v1_container_port.py new file mode 100644 index 0000000000..759dbfaae9 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_container_port.py @@ -0,0 +1,246 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ContainerPort(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'container_port': 'int', + 'host_ip': 'str', + 'host_port': 'int', + 'name': 'str', + 'protocol': 'str' + } + + attribute_map = { + 'container_port': 'containerPort', + 'host_ip': 'hostIP', + 'host_port': 'hostPort', + 'name': 'name', + 'protocol': 'protocol' + } + + def __init__(self, container_port=None, host_ip=None, host_port=None, name=None, protocol=None, local_vars_configuration=None): # noqa: E501 + """V1ContainerPort - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._container_port = None + self._host_ip = None + self._host_port = None + self._name = None + self._protocol = None + self.discriminator = None + + self.container_port = container_port + if host_ip is not None: + self.host_ip = host_ip + if host_port is not None: + self.host_port = host_port + if name is not None: + self.name = name + if protocol is not None: + self.protocol = protocol + + @property + def container_port(self): + """Gets the container_port of this V1ContainerPort. # noqa: E501 + + Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. # noqa: E501 + + :return: The container_port of this V1ContainerPort. # noqa: E501 + :rtype: int + """ + return self._container_port + + @container_port.setter + def container_port(self, container_port): + """Sets the container_port of this V1ContainerPort. + + Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. # noqa: E501 + + :param container_port: The container_port of this V1ContainerPort. # noqa: E501 + :type container_port: int + """ + if self.local_vars_configuration.client_side_validation and container_port is None: # noqa: E501 + raise ValueError("Invalid value for `container_port`, must not be `None`") # noqa: E501 + + self._container_port = container_port + + @property + def host_ip(self): + """Gets the host_ip of this V1ContainerPort. # noqa: E501 + + What host IP to bind the external port to. # noqa: E501 + + :return: The host_ip of this V1ContainerPort. # noqa: E501 + :rtype: str + """ + return self._host_ip + + @host_ip.setter + def host_ip(self, host_ip): + """Sets the host_ip of this V1ContainerPort. + + What host IP to bind the external port to. # noqa: E501 + + :param host_ip: The host_ip of this V1ContainerPort. # noqa: E501 + :type host_ip: str + """ + + self._host_ip = host_ip + + @property + def host_port(self): + """Gets the host_port of this V1ContainerPort. # noqa: E501 + + Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. # noqa: E501 + + :return: The host_port of this V1ContainerPort. # noqa: E501 + :rtype: int + """ + return self._host_port + + @host_port.setter + def host_port(self, host_port): + """Sets the host_port of this V1ContainerPort. + + Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. # noqa: E501 + + :param host_port: The host_port of this V1ContainerPort. # noqa: E501 + :type host_port: int + """ + + self._host_port = host_port + + @property + def name(self): + """Gets the name of this V1ContainerPort. # noqa: E501 + + If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. # noqa: E501 + + :return: The name of this V1ContainerPort. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1ContainerPort. + + If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. # noqa: E501 + + :param name: The name of this V1ContainerPort. # noqa: E501 + :type name: str + """ + + self._name = name + + @property + def protocol(self): + """Gets the protocol of this V1ContainerPort. # noqa: E501 + + Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\". # noqa: E501 + + :return: The protocol of this V1ContainerPort. # noqa: E501 + :rtype: str + """ + return self._protocol + + @protocol.setter + def protocol(self, protocol): + """Sets the protocol of this V1ContainerPort. + + Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\". # noqa: E501 + + :param protocol: The protocol of this V1ContainerPort. # noqa: E501 + :type protocol: str + """ + + self._protocol = protocol + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ContainerPort): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ContainerPort): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_container_resize_policy.py b/kubernetes_asyncio/client/models/v1_container_resize_policy.py new file mode 100644 index 0000000000..58e6d2b894 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_container_resize_policy.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ContainerResizePolicy(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'resource_name': 'str', + 'restart_policy': 'str' + } + + attribute_map = { + 'resource_name': 'resourceName', + 'restart_policy': 'restartPolicy' + } + + def __init__(self, resource_name=None, restart_policy=None, local_vars_configuration=None): # noqa: E501 + """V1ContainerResizePolicy - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._resource_name = None + self._restart_policy = None + self.discriminator = None + + self.resource_name = resource_name + self.restart_policy = restart_policy + + @property + def resource_name(self): + """Gets the resource_name of this V1ContainerResizePolicy. # noqa: E501 + + Name of the resource to which this resource resize policy applies. Supported values: cpu, memory. # noqa: E501 + + :return: The resource_name of this V1ContainerResizePolicy. # noqa: E501 + :rtype: str + """ + return self._resource_name + + @resource_name.setter + def resource_name(self, resource_name): + """Sets the resource_name of this V1ContainerResizePolicy. + + Name of the resource to which this resource resize policy applies. Supported values: cpu, memory. # noqa: E501 + + :param resource_name: The resource_name of this V1ContainerResizePolicy. # noqa: E501 + :type resource_name: str + """ + if self.local_vars_configuration.client_side_validation and resource_name is None: # noqa: E501 + raise ValueError("Invalid value for `resource_name`, must not be `None`") # noqa: E501 + + self._resource_name = resource_name + + @property + def restart_policy(self): + """Gets the restart_policy of this V1ContainerResizePolicy. # noqa: E501 + + Restart policy to apply when specified resource is resized. If not specified, it defaults to NotRequired. # noqa: E501 + + :return: The restart_policy of this V1ContainerResizePolicy. # noqa: E501 + :rtype: str + """ + return self._restart_policy + + @restart_policy.setter + def restart_policy(self, restart_policy): + """Sets the restart_policy of this V1ContainerResizePolicy. + + Restart policy to apply when specified resource is resized. If not specified, it defaults to NotRequired. # noqa: E501 + + :param restart_policy: The restart_policy of this V1ContainerResizePolicy. # noqa: E501 + :type restart_policy: str + """ + if self.local_vars_configuration.client_side_validation and restart_policy is None: # noqa: E501 + raise ValueError("Invalid value for `restart_policy`, must not be `None`") # noqa: E501 + + self._restart_policy = restart_policy + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ContainerResizePolicy): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ContainerResizePolicy): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_container_restart_rule.py b/kubernetes_asyncio/client/models/v1_container_restart_rule.py new file mode 100644 index 0000000000..699256a6ed --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_container_restart_rule.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ContainerRestartRule(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'action': 'str', + 'exit_codes': 'V1ContainerRestartRuleOnExitCodes' + } + + attribute_map = { + 'action': 'action', + 'exit_codes': 'exitCodes' + } + + def __init__(self, action=None, exit_codes=None, local_vars_configuration=None): # noqa: E501 + """V1ContainerRestartRule - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._action = None + self._exit_codes = None + self.discriminator = None + + self.action = action + if exit_codes is not None: + self.exit_codes = exit_codes + + @property + def action(self): + """Gets the action of this V1ContainerRestartRule. # noqa: E501 + + Specifies the action taken on a container exit if the requirements are satisfied. The only possible value is \"Restart\" to restart the container. # noqa: E501 + + :return: The action of this V1ContainerRestartRule. # noqa: E501 + :rtype: str + """ + return self._action + + @action.setter + def action(self, action): + """Sets the action of this V1ContainerRestartRule. + + Specifies the action taken on a container exit if the requirements are satisfied. The only possible value is \"Restart\" to restart the container. # noqa: E501 + + :param action: The action of this V1ContainerRestartRule. # noqa: E501 + :type action: str + """ + if self.local_vars_configuration.client_side_validation and action is None: # noqa: E501 + raise ValueError("Invalid value for `action`, must not be `None`") # noqa: E501 + + self._action = action + + @property + def exit_codes(self): + """Gets the exit_codes of this V1ContainerRestartRule. # noqa: E501 + + + :return: The exit_codes of this V1ContainerRestartRule. # noqa: E501 + :rtype: V1ContainerRestartRuleOnExitCodes + """ + return self._exit_codes + + @exit_codes.setter + def exit_codes(self, exit_codes): + """Sets the exit_codes of this V1ContainerRestartRule. + + + :param exit_codes: The exit_codes of this V1ContainerRestartRule. # noqa: E501 + :type exit_codes: V1ContainerRestartRuleOnExitCodes + """ + + self._exit_codes = exit_codes + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ContainerRestartRule): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ContainerRestartRule): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_container_restart_rule_on_exit_codes.py b/kubernetes_asyncio/client/models/v1_container_restart_rule_on_exit_codes.py new file mode 100644 index 0000000000..990053b9f1 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_container_restart_rule_on_exit_codes.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ContainerRestartRuleOnExitCodes(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'operator': 'str', + 'values': 'list[int]' + } + + attribute_map = { + 'operator': 'operator', + 'values': 'values' + } + + def __init__(self, operator=None, values=None, local_vars_configuration=None): # noqa: E501 + """V1ContainerRestartRuleOnExitCodes - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._operator = None + self._values = None + self.discriminator = None + + self.operator = operator + if values is not None: + self.values = values + + @property + def operator(self): + """Gets the operator of this V1ContainerRestartRuleOnExitCodes. # noqa: E501 + + Represents the relationship between the container exit code(s) and the specified values. Possible values are: - In: the requirement is satisfied if the container exit code is in the set of specified values. - NotIn: the requirement is satisfied if the container exit code is not in the set of specified values. # noqa: E501 + + :return: The operator of this V1ContainerRestartRuleOnExitCodes. # noqa: E501 + :rtype: str + """ + return self._operator + + @operator.setter + def operator(self, operator): + """Sets the operator of this V1ContainerRestartRuleOnExitCodes. + + Represents the relationship between the container exit code(s) and the specified values. Possible values are: - In: the requirement is satisfied if the container exit code is in the set of specified values. - NotIn: the requirement is satisfied if the container exit code is not in the set of specified values. # noqa: E501 + + :param operator: The operator of this V1ContainerRestartRuleOnExitCodes. # noqa: E501 + :type operator: str + """ + if self.local_vars_configuration.client_side_validation and operator is None: # noqa: E501 + raise ValueError("Invalid value for `operator`, must not be `None`") # noqa: E501 + + self._operator = operator + + @property + def values(self): + """Gets the values of this V1ContainerRestartRuleOnExitCodes. # noqa: E501 + + Specifies the set of values to check for container exit codes. At most 255 elements are allowed. # noqa: E501 + + :return: The values of this V1ContainerRestartRuleOnExitCodes. # noqa: E501 + :rtype: list[int] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this V1ContainerRestartRuleOnExitCodes. + + Specifies the set of values to check for container exit codes. At most 255 elements are allowed. # noqa: E501 + + :param values: The values of this V1ContainerRestartRuleOnExitCodes. # noqa: E501 + :type values: list[int] + """ + + self._values = values + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ContainerRestartRuleOnExitCodes): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ContainerRestartRuleOnExitCodes): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_container_state.py b/kubernetes_asyncio/client/models/v1_container_state.py new file mode 100644 index 0000000000..ee1ff7ec69 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_container_state.py @@ -0,0 +1,183 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ContainerState(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'running': 'V1ContainerStateRunning', + 'terminated': 'V1ContainerStateTerminated', + 'waiting': 'V1ContainerStateWaiting' + } + + attribute_map = { + 'running': 'running', + 'terminated': 'terminated', + 'waiting': 'waiting' + } + + def __init__(self, running=None, terminated=None, waiting=None, local_vars_configuration=None): # noqa: E501 + """V1ContainerState - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._running = None + self._terminated = None + self._waiting = None + self.discriminator = None + + if running is not None: + self.running = running + if terminated is not None: + self.terminated = terminated + if waiting is not None: + self.waiting = waiting + + @property + def running(self): + """Gets the running of this V1ContainerState. # noqa: E501 + + + :return: The running of this V1ContainerState. # noqa: E501 + :rtype: V1ContainerStateRunning + """ + return self._running + + @running.setter + def running(self, running): + """Sets the running of this V1ContainerState. + + + :param running: The running of this V1ContainerState. # noqa: E501 + :type running: V1ContainerStateRunning + """ + + self._running = running + + @property + def terminated(self): + """Gets the terminated of this V1ContainerState. # noqa: E501 + + + :return: The terminated of this V1ContainerState. # noqa: E501 + :rtype: V1ContainerStateTerminated + """ + return self._terminated + + @terminated.setter + def terminated(self, terminated): + """Sets the terminated of this V1ContainerState. + + + :param terminated: The terminated of this V1ContainerState. # noqa: E501 + :type terminated: V1ContainerStateTerminated + """ + + self._terminated = terminated + + @property + def waiting(self): + """Gets the waiting of this V1ContainerState. # noqa: E501 + + + :return: The waiting of this V1ContainerState. # noqa: E501 + :rtype: V1ContainerStateWaiting + """ + return self._waiting + + @waiting.setter + def waiting(self, waiting): + """Sets the waiting of this V1ContainerState. + + + :param waiting: The waiting of this V1ContainerState. # noqa: E501 + :type waiting: V1ContainerStateWaiting + """ + + self._waiting = waiting + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ContainerState): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ContainerState): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_container_state_running.py b/kubernetes_asyncio/client/models/v1_container_state_running.py new file mode 100644 index 0000000000..04823515ae --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_container_state_running.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ContainerStateRunning(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'started_at': 'datetime' + } + + attribute_map = { + 'started_at': 'startedAt' + } + + def __init__(self, started_at=None, local_vars_configuration=None): # noqa: E501 + """V1ContainerStateRunning - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._started_at = None + self.discriminator = None + + if started_at is not None: + self.started_at = started_at + + @property + def started_at(self): + """Gets the started_at of this V1ContainerStateRunning. # noqa: E501 + + Time at which the container was last (re-)started # noqa: E501 + + :return: The started_at of this V1ContainerStateRunning. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this V1ContainerStateRunning. + + Time at which the container was last (re-)started # noqa: E501 + + :param started_at: The started_at of this V1ContainerStateRunning. # noqa: E501 + :type started_at: datetime + """ + + self._started_at = started_at + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ContainerStateRunning): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ContainerStateRunning): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_container_state_terminated.py b/kubernetes_asyncio/client/models/v1_container_state_terminated.py new file mode 100644 index 0000000000..d99b9f6a1c --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_container_state_terminated.py @@ -0,0 +1,302 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ContainerStateTerminated(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'container_id': 'str', + 'exit_code': 'int', + 'finished_at': 'datetime', + 'message': 'str', + 'reason': 'str', + 'signal': 'int', + 'started_at': 'datetime' + } + + attribute_map = { + 'container_id': 'containerID', + 'exit_code': 'exitCode', + 'finished_at': 'finishedAt', + 'message': 'message', + 'reason': 'reason', + 'signal': 'signal', + 'started_at': 'startedAt' + } + + def __init__(self, container_id=None, exit_code=None, finished_at=None, message=None, reason=None, signal=None, started_at=None, local_vars_configuration=None): # noqa: E501 + """V1ContainerStateTerminated - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._container_id = None + self._exit_code = None + self._finished_at = None + self._message = None + self._reason = None + self._signal = None + self._started_at = None + self.discriminator = None + + if container_id is not None: + self.container_id = container_id + self.exit_code = exit_code + if finished_at is not None: + self.finished_at = finished_at + if message is not None: + self.message = message + if reason is not None: + self.reason = reason + if signal is not None: + self.signal = signal + if started_at is not None: + self.started_at = started_at + + @property + def container_id(self): + """Gets the container_id of this V1ContainerStateTerminated. # noqa: E501 + + Container's ID in the format '://' # noqa: E501 + + :return: The container_id of this V1ContainerStateTerminated. # noqa: E501 + :rtype: str + """ + return self._container_id + + @container_id.setter + def container_id(self, container_id): + """Sets the container_id of this V1ContainerStateTerminated. + + Container's ID in the format '://' # noqa: E501 + + :param container_id: The container_id of this V1ContainerStateTerminated. # noqa: E501 + :type container_id: str + """ + + self._container_id = container_id + + @property + def exit_code(self): + """Gets the exit_code of this V1ContainerStateTerminated. # noqa: E501 + + Exit status from the last termination of the container # noqa: E501 + + :return: The exit_code of this V1ContainerStateTerminated. # noqa: E501 + :rtype: int + """ + return self._exit_code + + @exit_code.setter + def exit_code(self, exit_code): + """Sets the exit_code of this V1ContainerStateTerminated. + + Exit status from the last termination of the container # noqa: E501 + + :param exit_code: The exit_code of this V1ContainerStateTerminated. # noqa: E501 + :type exit_code: int + """ + if self.local_vars_configuration.client_side_validation and exit_code is None: # noqa: E501 + raise ValueError("Invalid value for `exit_code`, must not be `None`") # noqa: E501 + + self._exit_code = exit_code + + @property + def finished_at(self): + """Gets the finished_at of this V1ContainerStateTerminated. # noqa: E501 + + Time at which the container last terminated # noqa: E501 + + :return: The finished_at of this V1ContainerStateTerminated. # noqa: E501 + :rtype: datetime + """ + return self._finished_at + + @finished_at.setter + def finished_at(self, finished_at): + """Sets the finished_at of this V1ContainerStateTerminated. + + Time at which the container last terminated # noqa: E501 + + :param finished_at: The finished_at of this V1ContainerStateTerminated. # noqa: E501 + :type finished_at: datetime + """ + + self._finished_at = finished_at + + @property + def message(self): + """Gets the message of this V1ContainerStateTerminated. # noqa: E501 + + Message regarding the last termination of the container # noqa: E501 + + :return: The message of this V1ContainerStateTerminated. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this V1ContainerStateTerminated. + + Message regarding the last termination of the container # noqa: E501 + + :param message: The message of this V1ContainerStateTerminated. # noqa: E501 + :type message: str + """ + + self._message = message + + @property + def reason(self): + """Gets the reason of this V1ContainerStateTerminated. # noqa: E501 + + (brief) reason from the last termination of the container # noqa: E501 + + :return: The reason of this V1ContainerStateTerminated. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this V1ContainerStateTerminated. + + (brief) reason from the last termination of the container # noqa: E501 + + :param reason: The reason of this V1ContainerStateTerminated. # noqa: E501 + :type reason: str + """ + + self._reason = reason + + @property + def signal(self): + """Gets the signal of this V1ContainerStateTerminated. # noqa: E501 + + Signal from the last termination of the container # noqa: E501 + + :return: The signal of this V1ContainerStateTerminated. # noqa: E501 + :rtype: int + """ + return self._signal + + @signal.setter + def signal(self, signal): + """Sets the signal of this V1ContainerStateTerminated. + + Signal from the last termination of the container # noqa: E501 + + :param signal: The signal of this V1ContainerStateTerminated. # noqa: E501 + :type signal: int + """ + + self._signal = signal + + @property + def started_at(self): + """Gets the started_at of this V1ContainerStateTerminated. # noqa: E501 + + Time at which previous execution of the container started # noqa: E501 + + :return: The started_at of this V1ContainerStateTerminated. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this V1ContainerStateTerminated. + + Time at which previous execution of the container started # noqa: E501 + + :param started_at: The started_at of this V1ContainerStateTerminated. # noqa: E501 + :type started_at: datetime + """ + + self._started_at = started_at + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ContainerStateTerminated): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ContainerStateTerminated): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_container_state_waiting.py b/kubernetes_asyncio/client/models/v1_container_state_waiting.py new file mode 100644 index 0000000000..eb511a886c --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_container_state_waiting.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ContainerStateWaiting(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'message': 'str', + 'reason': 'str' + } + + attribute_map = { + 'message': 'message', + 'reason': 'reason' + } + + def __init__(self, message=None, reason=None, local_vars_configuration=None): # noqa: E501 + """V1ContainerStateWaiting - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._message = None + self._reason = None + self.discriminator = None + + if message is not None: + self.message = message + if reason is not None: + self.reason = reason + + @property + def message(self): + """Gets the message of this V1ContainerStateWaiting. # noqa: E501 + + Message regarding why the container is not yet running. # noqa: E501 + + :return: The message of this V1ContainerStateWaiting. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this V1ContainerStateWaiting. + + Message regarding why the container is not yet running. # noqa: E501 + + :param message: The message of this V1ContainerStateWaiting. # noqa: E501 + :type message: str + """ + + self._message = message + + @property + def reason(self): + """Gets the reason of this V1ContainerStateWaiting. # noqa: E501 + + (brief) reason the container is not yet running. # noqa: E501 + + :return: The reason of this V1ContainerStateWaiting. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this V1ContainerStateWaiting. + + (brief) reason the container is not yet running. # noqa: E501 + + :param reason: The reason of this V1ContainerStateWaiting. # noqa: E501 + :type reason: str + """ + + self._reason = reason + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ContainerStateWaiting): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ContainerStateWaiting): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_container_status.py b/kubernetes_asyncio/client/models/v1_container_status.py new file mode 100644 index 0000000000..959003f918 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_container_status.py @@ -0,0 +1,522 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ContainerStatus(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'allocated_resources': 'dict[str, str]', + 'allocated_resources_status': 'list[V1ResourceStatus]', + 'container_id': 'str', + 'image': 'str', + 'image_id': 'str', + 'last_state': 'V1ContainerState', + 'name': 'str', + 'ready': 'bool', + 'resources': 'V1ResourceRequirements', + 'restart_count': 'int', + 'started': 'bool', + 'state': 'V1ContainerState', + 'stop_signal': 'str', + 'user': 'V1ContainerUser', + 'volume_mounts': 'list[V1VolumeMountStatus]' + } + + attribute_map = { + 'allocated_resources': 'allocatedResources', + 'allocated_resources_status': 'allocatedResourcesStatus', + 'container_id': 'containerID', + 'image': 'image', + 'image_id': 'imageID', + 'last_state': 'lastState', + 'name': 'name', + 'ready': 'ready', + 'resources': 'resources', + 'restart_count': 'restartCount', + 'started': 'started', + 'state': 'state', + 'stop_signal': 'stopSignal', + 'user': 'user', + 'volume_mounts': 'volumeMounts' + } + + def __init__(self, allocated_resources=None, allocated_resources_status=None, container_id=None, image=None, image_id=None, last_state=None, name=None, ready=None, resources=None, restart_count=None, started=None, state=None, stop_signal=None, user=None, volume_mounts=None, local_vars_configuration=None): # noqa: E501 + """V1ContainerStatus - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._allocated_resources = None + self._allocated_resources_status = None + self._container_id = None + self._image = None + self._image_id = None + self._last_state = None + self._name = None + self._ready = None + self._resources = None + self._restart_count = None + self._started = None + self._state = None + self._stop_signal = None + self._user = None + self._volume_mounts = None + self.discriminator = None + + if allocated_resources is not None: + self.allocated_resources = allocated_resources + if allocated_resources_status is not None: + self.allocated_resources_status = allocated_resources_status + if container_id is not None: + self.container_id = container_id + self.image = image + self.image_id = image_id + if last_state is not None: + self.last_state = last_state + self.name = name + self.ready = ready + if resources is not None: + self.resources = resources + self.restart_count = restart_count + if started is not None: + self.started = started + if state is not None: + self.state = state + if stop_signal is not None: + self.stop_signal = stop_signal + if user is not None: + self.user = user + if volume_mounts is not None: + self.volume_mounts = volume_mounts + + @property + def allocated_resources(self): + """Gets the allocated_resources of this V1ContainerStatus. # noqa: E501 + + AllocatedResources represents the compute resources allocated for this container by the node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission and after successfully admitting desired pod resize. # noqa: E501 + + :return: The allocated_resources of this V1ContainerStatus. # noqa: E501 + :rtype: dict[str, str] + """ + return self._allocated_resources + + @allocated_resources.setter + def allocated_resources(self, allocated_resources): + """Sets the allocated_resources of this V1ContainerStatus. + + AllocatedResources represents the compute resources allocated for this container by the node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission and after successfully admitting desired pod resize. # noqa: E501 + + :param allocated_resources: The allocated_resources of this V1ContainerStatus. # noqa: E501 + :type allocated_resources: dict[str, str] + """ + + self._allocated_resources = allocated_resources + + @property + def allocated_resources_status(self): + """Gets the allocated_resources_status of this V1ContainerStatus. # noqa: E501 + + AllocatedResourcesStatus represents the status of various resources allocated for this Pod. # noqa: E501 + + :return: The allocated_resources_status of this V1ContainerStatus. # noqa: E501 + :rtype: list[V1ResourceStatus] + """ + return self._allocated_resources_status + + @allocated_resources_status.setter + def allocated_resources_status(self, allocated_resources_status): + """Sets the allocated_resources_status of this V1ContainerStatus. + + AllocatedResourcesStatus represents the status of various resources allocated for this Pod. # noqa: E501 + + :param allocated_resources_status: The allocated_resources_status of this V1ContainerStatus. # noqa: E501 + :type allocated_resources_status: list[V1ResourceStatus] + """ + + self._allocated_resources_status = allocated_resources_status + + @property + def container_id(self): + """Gets the container_id of this V1ContainerStatus. # noqa: E501 + + ContainerID is the ID of the container in the format '://'. Where type is a container runtime identifier, returned from Version call of CRI API (for example \"containerd\"). # noqa: E501 + + :return: The container_id of this V1ContainerStatus. # noqa: E501 + :rtype: str + """ + return self._container_id + + @container_id.setter + def container_id(self, container_id): + """Sets the container_id of this V1ContainerStatus. + + ContainerID is the ID of the container in the format '://'. Where type is a container runtime identifier, returned from Version call of CRI API (for example \"containerd\"). # noqa: E501 + + :param container_id: The container_id of this V1ContainerStatus. # noqa: E501 + :type container_id: str + """ + + self._container_id = container_id + + @property + def image(self): + """Gets the image of this V1ContainerStatus. # noqa: E501 + + Image is the name of container image that the container is running. The container image may not match the image used in the PodSpec, as it may have been resolved by the runtime. More info: https://kubernetes.io/docs/concepts/containers/images. # noqa: E501 + + :return: The image of this V1ContainerStatus. # noqa: E501 + :rtype: str + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this V1ContainerStatus. + + Image is the name of container image that the container is running. The container image may not match the image used in the PodSpec, as it may have been resolved by the runtime. More info: https://kubernetes.io/docs/concepts/containers/images. # noqa: E501 + + :param image: The image of this V1ContainerStatus. # noqa: E501 + :type image: str + """ + if self.local_vars_configuration.client_side_validation and image is None: # noqa: E501 + raise ValueError("Invalid value for `image`, must not be `None`") # noqa: E501 + + self._image = image + + @property + def image_id(self): + """Gets the image_id of this V1ContainerStatus. # noqa: E501 + + ImageID is the image ID of the container's image. The image ID may not match the image ID of the image used in the PodSpec, as it may have been resolved by the runtime. # noqa: E501 + + :return: The image_id of this V1ContainerStatus. # noqa: E501 + :rtype: str + """ + return self._image_id + + @image_id.setter + def image_id(self, image_id): + """Sets the image_id of this V1ContainerStatus. + + ImageID is the image ID of the container's image. The image ID may not match the image ID of the image used in the PodSpec, as it may have been resolved by the runtime. # noqa: E501 + + :param image_id: The image_id of this V1ContainerStatus. # noqa: E501 + :type image_id: str + """ + if self.local_vars_configuration.client_side_validation and image_id is None: # noqa: E501 + raise ValueError("Invalid value for `image_id`, must not be `None`") # noqa: E501 + + self._image_id = image_id + + @property + def last_state(self): + """Gets the last_state of this V1ContainerStatus. # noqa: E501 + + + :return: The last_state of this V1ContainerStatus. # noqa: E501 + :rtype: V1ContainerState + """ + return self._last_state + + @last_state.setter + def last_state(self, last_state): + """Sets the last_state of this V1ContainerStatus. + + + :param last_state: The last_state of this V1ContainerStatus. # noqa: E501 + :type last_state: V1ContainerState + """ + + self._last_state = last_state + + @property + def name(self): + """Gets the name of this V1ContainerStatus. # noqa: E501 + + Name is a DNS_LABEL representing the unique name of the container. Each container in a pod must have a unique name across all container types. Cannot be updated. # noqa: E501 + + :return: The name of this V1ContainerStatus. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1ContainerStatus. + + Name is a DNS_LABEL representing the unique name of the container. Each container in a pod must have a unique name across all container types. Cannot be updated. # noqa: E501 + + :param name: The name of this V1ContainerStatus. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def ready(self): + """Gets the ready of this V1ContainerStatus. # noqa: E501 + + Ready specifies whether the container is currently passing its readiness check. The value will change as readiness probes keep executing. If no readiness probes are specified, this field defaults to true once the container is fully started (see Started field). The value is typically used to determine whether a container is ready to accept traffic. # noqa: E501 + + :return: The ready of this V1ContainerStatus. # noqa: E501 + :rtype: bool + """ + return self._ready + + @ready.setter + def ready(self, ready): + """Sets the ready of this V1ContainerStatus. + + Ready specifies whether the container is currently passing its readiness check. The value will change as readiness probes keep executing. If no readiness probes are specified, this field defaults to true once the container is fully started (see Started field). The value is typically used to determine whether a container is ready to accept traffic. # noqa: E501 + + :param ready: The ready of this V1ContainerStatus. # noqa: E501 + :type ready: bool + """ + if self.local_vars_configuration.client_side_validation and ready is None: # noqa: E501 + raise ValueError("Invalid value for `ready`, must not be `None`") # noqa: E501 + + self._ready = ready + + @property + def resources(self): + """Gets the resources of this V1ContainerStatus. # noqa: E501 + + + :return: The resources of this V1ContainerStatus. # noqa: E501 + :rtype: V1ResourceRequirements + """ + return self._resources + + @resources.setter + def resources(self, resources): + """Sets the resources of this V1ContainerStatus. + + + :param resources: The resources of this V1ContainerStatus. # noqa: E501 + :type resources: V1ResourceRequirements + """ + + self._resources = resources + + @property + def restart_count(self): + """Gets the restart_count of this V1ContainerStatus. # noqa: E501 + + RestartCount holds the number of times the container has been restarted. Kubelet makes an effort to always increment the value, but there are cases when the state may be lost due to node restarts and then the value may be reset to 0. The value is never negative. # noqa: E501 + + :return: The restart_count of this V1ContainerStatus. # noqa: E501 + :rtype: int + """ + return self._restart_count + + @restart_count.setter + def restart_count(self, restart_count): + """Sets the restart_count of this V1ContainerStatus. + + RestartCount holds the number of times the container has been restarted. Kubelet makes an effort to always increment the value, but there are cases when the state may be lost due to node restarts and then the value may be reset to 0. The value is never negative. # noqa: E501 + + :param restart_count: The restart_count of this V1ContainerStatus. # noqa: E501 + :type restart_count: int + """ + if self.local_vars_configuration.client_side_validation and restart_count is None: # noqa: E501 + raise ValueError("Invalid value for `restart_count`, must not be `None`") # noqa: E501 + + self._restart_count = restart_count + + @property + def started(self): + """Gets the started of this V1ContainerStatus. # noqa: E501 + + Started indicates whether the container has finished its postStart lifecycle hook and passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. In both cases, startup probes will run again. Is always true when no startupProbe is defined and container is running and has passed the postStart lifecycle hook. The null value must be treated the same as false. # noqa: E501 + + :return: The started of this V1ContainerStatus. # noqa: E501 + :rtype: bool + """ + return self._started + + @started.setter + def started(self, started): + """Sets the started of this V1ContainerStatus. + + Started indicates whether the container has finished its postStart lifecycle hook and passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. In both cases, startup probes will run again. Is always true when no startupProbe is defined and container is running and has passed the postStart lifecycle hook. The null value must be treated the same as false. # noqa: E501 + + :param started: The started of this V1ContainerStatus. # noqa: E501 + :type started: bool + """ + + self._started = started + + @property + def state(self): + """Gets the state of this V1ContainerStatus. # noqa: E501 + + + :return: The state of this V1ContainerStatus. # noqa: E501 + :rtype: V1ContainerState + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this V1ContainerStatus. + + + :param state: The state of this V1ContainerStatus. # noqa: E501 + :type state: V1ContainerState + """ + + self._state = state + + @property + def stop_signal(self): + """Gets the stop_signal of this V1ContainerStatus. # noqa: E501 + + StopSignal reports the effective stop signal for this container # noqa: E501 + + :return: The stop_signal of this V1ContainerStatus. # noqa: E501 + :rtype: str + """ + return self._stop_signal + + @stop_signal.setter + def stop_signal(self, stop_signal): + """Sets the stop_signal of this V1ContainerStatus. + + StopSignal reports the effective stop signal for this container # noqa: E501 + + :param stop_signal: The stop_signal of this V1ContainerStatus. # noqa: E501 + :type stop_signal: str + """ + + self._stop_signal = stop_signal + + @property + def user(self): + """Gets the user of this V1ContainerStatus. # noqa: E501 + + + :return: The user of this V1ContainerStatus. # noqa: E501 + :rtype: V1ContainerUser + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this V1ContainerStatus. + + + :param user: The user of this V1ContainerStatus. # noqa: E501 + :type user: V1ContainerUser + """ + + self._user = user + + @property + def volume_mounts(self): + """Gets the volume_mounts of this V1ContainerStatus. # noqa: E501 + + Status of volume mounts. # noqa: E501 + + :return: The volume_mounts of this V1ContainerStatus. # noqa: E501 + :rtype: list[V1VolumeMountStatus] + """ + return self._volume_mounts + + @volume_mounts.setter + def volume_mounts(self, volume_mounts): + """Sets the volume_mounts of this V1ContainerStatus. + + Status of volume mounts. # noqa: E501 + + :param volume_mounts: The volume_mounts of this V1ContainerStatus. # noqa: E501 + :type volume_mounts: list[V1VolumeMountStatus] + """ + + self._volume_mounts = volume_mounts + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ContainerStatus): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ContainerStatus): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_container_user.py b/kubernetes_asyncio/client/models/v1_container_user.py new file mode 100644 index 0000000000..f5140bc8b5 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_container_user.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ContainerUser(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'linux': 'V1LinuxContainerUser' + } + + attribute_map = { + 'linux': 'linux' + } + + def __init__(self, linux=None, local_vars_configuration=None): # noqa: E501 + """V1ContainerUser - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._linux = None + self.discriminator = None + + if linux is not None: + self.linux = linux + + @property + def linux(self): + """Gets the linux of this V1ContainerUser. # noqa: E501 + + + :return: The linux of this V1ContainerUser. # noqa: E501 + :rtype: V1LinuxContainerUser + """ + return self._linux + + @linux.setter + def linux(self, linux): + """Sets the linux of this V1ContainerUser. + + + :param linux: The linux of this V1ContainerUser. # noqa: E501 + :type linux: V1LinuxContainerUser + """ + + self._linux = linux + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ContainerUser): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ContainerUser): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_controller_revision.py b/kubernetes_asyncio/client/models/v1_controller_revision.py new file mode 100644 index 0000000000..fee50671e3 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_controller_revision.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ControllerRevision(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'data': 'object', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'revision': 'int' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'data': 'data', + 'kind': 'kind', + 'metadata': 'metadata', + 'revision': 'revision' + } + + def __init__(self, api_version=None, data=None, kind=None, metadata=None, revision=None, local_vars_configuration=None): # noqa: E501 + """V1ControllerRevision - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._data = None + self._kind = None + self._metadata = None + self._revision = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if data is not None: + self.data = data + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + self.revision = revision + + @property + def api_version(self): + """Gets the api_version of this V1ControllerRevision. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1ControllerRevision. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1ControllerRevision. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1ControllerRevision. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def data(self): + """Gets the data of this V1ControllerRevision. # noqa: E501 + + Data is the serialized representation of the state. # noqa: E501 + + :return: The data of this V1ControllerRevision. # noqa: E501 + :rtype: object + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this V1ControllerRevision. + + Data is the serialized representation of the state. # noqa: E501 + + :param data: The data of this V1ControllerRevision. # noqa: E501 + :type data: object + """ + + self._data = data + + @property + def kind(self): + """Gets the kind of this V1ControllerRevision. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1ControllerRevision. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1ControllerRevision. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1ControllerRevision. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1ControllerRevision. # noqa: E501 + + + :return: The metadata of this V1ControllerRevision. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1ControllerRevision. + + + :param metadata: The metadata of this V1ControllerRevision. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def revision(self): + """Gets the revision of this V1ControllerRevision. # noqa: E501 + + Revision indicates the revision of the state represented by Data. # noqa: E501 + + :return: The revision of this V1ControllerRevision. # noqa: E501 + :rtype: int + """ + return self._revision + + @revision.setter + def revision(self, revision): + """Sets the revision of this V1ControllerRevision. + + Revision indicates the revision of the state represented by Data. # noqa: E501 + + :param revision: The revision of this V1ControllerRevision. # noqa: E501 + :type revision: int + """ + if self.local_vars_configuration.client_side_validation and revision is None: # noqa: E501 + raise ValueError("Invalid value for `revision`, must not be `None`") # noqa: E501 + + self._revision = revision + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ControllerRevision): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ControllerRevision): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_controller_revision_list.py b/kubernetes_asyncio/client/models/v1_controller_revision_list.py new file mode 100644 index 0000000000..516cdd4f00 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_controller_revision_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1ControllerRevisionList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1ControllerRevision]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1ControllerRevisionList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1ControllerRevisionList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1ControllerRevisionList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1ControllerRevisionList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1ControllerRevisionList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1ControllerRevisionList. # noqa: E501 + + Items is the list of ControllerRevisions # noqa: E501 + + :return: The items of this V1ControllerRevisionList. # noqa: E501 + :rtype: list[V1ControllerRevision] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1ControllerRevisionList. + + Items is the list of ControllerRevisions # noqa: E501 + + :param items: The items of this V1ControllerRevisionList. # noqa: E501 + :type items: list[V1ControllerRevision] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1ControllerRevisionList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1ControllerRevisionList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1ControllerRevisionList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1ControllerRevisionList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1ControllerRevisionList. # noqa: E501 + + + :return: The metadata of this V1ControllerRevisionList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1ControllerRevisionList. + + + :param metadata: The metadata of this V1ControllerRevisionList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1ControllerRevisionList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1ControllerRevisionList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_counter.py b/kubernetes_asyncio/client/models/v1_counter.py new file mode 100644 index 0000000000..b0ffab46a2 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_counter.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1Counter(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'value': 'str' + } + + attribute_map = { + 'value': 'value' + } + + def __init__(self, value=None, local_vars_configuration=None): # noqa: E501 + """V1Counter - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._value = None + self.discriminator = None + + self.value = value + + @property + def value(self): + """Gets the value of this V1Counter. # noqa: E501 + + Value defines how much of a certain device counter is available. # noqa: E501 + + :return: The value of this V1Counter. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this V1Counter. + + Value defines how much of a certain device counter is available. # noqa: E501 + + :param value: The value of this V1Counter. # noqa: E501 + :type value: str + """ + if self.local_vars_configuration.client_side_validation and value is None: # noqa: E501 + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1Counter): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1Counter): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_counter_set.py b/kubernetes_asyncio/client/models/v1_counter_set.py new file mode 100644 index 0000000000..7168b13394 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_counter_set.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CounterSet(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'counters': 'dict[str, V1Counter]', + 'name': 'str' + } + + attribute_map = { + 'counters': 'counters', + 'name': 'name' + } + + def __init__(self, counters=None, name=None, local_vars_configuration=None): # noqa: E501 + """V1CounterSet - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._counters = None + self._name = None + self.discriminator = None + + self.counters = counters + self.name = name + + @property + def counters(self): + """Gets the counters of this V1CounterSet. # noqa: E501 + + Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label. The maximum number of counters is 32. # noqa: E501 + + :return: The counters of this V1CounterSet. # noqa: E501 + :rtype: dict[str, V1Counter] + """ + return self._counters + + @counters.setter + def counters(self, counters): + """Sets the counters of this V1CounterSet. + + Counters defines the set of counters for this CounterSet The name of each counter must be unique in that set and must be a DNS label. The maximum number of counters is 32. # noqa: E501 + + :param counters: The counters of this V1CounterSet. # noqa: E501 + :type counters: dict[str, V1Counter] + """ + if self.local_vars_configuration.client_side_validation and counters is None: # noqa: E501 + raise ValueError("Invalid value for `counters`, must not be `None`") # noqa: E501 + + self._counters = counters + + @property + def name(self): + """Gets the name of this V1CounterSet. # noqa: E501 + + Name defines the name of the counter set. It must be a DNS label. # noqa: E501 + + :return: The name of this V1CounterSet. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1CounterSet. + + Name defines the name of the counter set. It must be a DNS label. # noqa: E501 + + :param name: The name of this V1CounterSet. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CounterSet): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CounterSet): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_cron_job.py b/kubernetes_asyncio/client/models/v1_cron_job.py new file mode 100644 index 0000000000..0f7f177280 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_cron_job.py @@ -0,0 +1,239 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CronJob(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'spec': 'V1CronJobSpec', + 'status': 'V1CronJobStatus' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'spec': 'spec', + 'status': 'status' + } + + def __init__(self, api_version=None, kind=None, metadata=None, spec=None, status=None, local_vars_configuration=None): # noqa: E501 + """V1CronJob - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._metadata = None + self._spec = None + self._status = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + if spec is not None: + self.spec = spec + if status is not None: + self.status = status + + @property + def api_version(self): + """Gets the api_version of this V1CronJob. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1CronJob. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1CronJob. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1CronJob. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1CronJob. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1CronJob. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CronJob. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1CronJob. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1CronJob. # noqa: E501 + + + :return: The metadata of this V1CronJob. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1CronJob. + + + :param metadata: The metadata of this V1CronJob. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def spec(self): + """Gets the spec of this V1CronJob. # noqa: E501 + + + :return: The spec of this V1CronJob. # noqa: E501 + :rtype: V1CronJobSpec + """ + return self._spec + + @spec.setter + def spec(self, spec): + """Sets the spec of this V1CronJob. + + + :param spec: The spec of this V1CronJob. # noqa: E501 + :type spec: V1CronJobSpec + """ + + self._spec = spec + + @property + def status(self): + """Gets the status of this V1CronJob. # noqa: E501 + + + :return: The status of this V1CronJob. # noqa: E501 + :rtype: V1CronJobStatus + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1CronJob. + + + :param status: The status of this V1CronJob. # noqa: E501 + :type status: V1CronJobStatus + """ + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CronJob): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CronJob): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_cron_job_list.py b/kubernetes_asyncio/client/models/v1_cron_job_list.py new file mode 100644 index 0000000000..f007238b5b --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_cron_job_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CronJobList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1CronJob]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1CronJobList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1CronJobList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1CronJobList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1CronJobList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1CronJobList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1CronJobList. # noqa: E501 + + items is the list of CronJobs. # noqa: E501 + + :return: The items of this V1CronJobList. # noqa: E501 + :rtype: list[V1CronJob] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1CronJobList. + + items is the list of CronJobs. # noqa: E501 + + :param items: The items of this V1CronJobList. # noqa: E501 + :type items: list[V1CronJob] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1CronJobList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1CronJobList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CronJobList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1CronJobList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1CronJobList. # noqa: E501 + + + :return: The metadata of this V1CronJobList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1CronJobList. + + + :param metadata: The metadata of this V1CronJobList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CronJobList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CronJobList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_cron_job_spec.py b/kubernetes_asyncio/client/models/v1_cron_job_spec.py new file mode 100644 index 0000000000..df03299092 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_cron_job_spec.py @@ -0,0 +1,329 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CronJobSpec(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'concurrency_policy': 'str', + 'failed_jobs_history_limit': 'int', + 'job_template': 'V1JobTemplateSpec', + 'schedule': 'str', + 'starting_deadline_seconds': 'int', + 'successful_jobs_history_limit': 'int', + 'suspend': 'bool', + 'time_zone': 'str' + } + + attribute_map = { + 'concurrency_policy': 'concurrencyPolicy', + 'failed_jobs_history_limit': 'failedJobsHistoryLimit', + 'job_template': 'jobTemplate', + 'schedule': 'schedule', + 'starting_deadline_seconds': 'startingDeadlineSeconds', + 'successful_jobs_history_limit': 'successfulJobsHistoryLimit', + 'suspend': 'suspend', + 'time_zone': 'timeZone' + } + + def __init__(self, concurrency_policy=None, failed_jobs_history_limit=None, job_template=None, schedule=None, starting_deadline_seconds=None, successful_jobs_history_limit=None, suspend=None, time_zone=None, local_vars_configuration=None): # noqa: E501 + """V1CronJobSpec - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._concurrency_policy = None + self._failed_jobs_history_limit = None + self._job_template = None + self._schedule = None + self._starting_deadline_seconds = None + self._successful_jobs_history_limit = None + self._suspend = None + self._time_zone = None + self.discriminator = None + + if concurrency_policy is not None: + self.concurrency_policy = concurrency_policy + if failed_jobs_history_limit is not None: + self.failed_jobs_history_limit = failed_jobs_history_limit + self.job_template = job_template + self.schedule = schedule + if starting_deadline_seconds is not None: + self.starting_deadline_seconds = starting_deadline_seconds + if successful_jobs_history_limit is not None: + self.successful_jobs_history_limit = successful_jobs_history_limit + if suspend is not None: + self.suspend = suspend + if time_zone is not None: + self.time_zone = time_zone + + @property + def concurrency_policy(self): + """Gets the concurrency_policy of this V1CronJobSpec. # noqa: E501 + + Specifies how to treat concurrent executions of a Job. Valid values are: - \"Allow\" (default): allows CronJobs to run concurrently; - \"Forbid\": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - \"Replace\": cancels currently running job and replaces it with a new one # noqa: E501 + + :return: The concurrency_policy of this V1CronJobSpec. # noqa: E501 + :rtype: str + """ + return self._concurrency_policy + + @concurrency_policy.setter + def concurrency_policy(self, concurrency_policy): + """Sets the concurrency_policy of this V1CronJobSpec. + + Specifies how to treat concurrent executions of a Job. Valid values are: - \"Allow\" (default): allows CronJobs to run concurrently; - \"Forbid\": forbids concurrent runs, skipping next run if previous run hasn't finished yet; - \"Replace\": cancels currently running job and replaces it with a new one # noqa: E501 + + :param concurrency_policy: The concurrency_policy of this V1CronJobSpec. # noqa: E501 + :type concurrency_policy: str + """ + + self._concurrency_policy = concurrency_policy + + @property + def failed_jobs_history_limit(self): + """Gets the failed_jobs_history_limit of this V1CronJobSpec. # noqa: E501 + + The number of failed finished jobs to retain. Value must be non-negative integer. Defaults to 1. # noqa: E501 + + :return: The failed_jobs_history_limit of this V1CronJobSpec. # noqa: E501 + :rtype: int + """ + return self._failed_jobs_history_limit + + @failed_jobs_history_limit.setter + def failed_jobs_history_limit(self, failed_jobs_history_limit): + """Sets the failed_jobs_history_limit of this V1CronJobSpec. + + The number of failed finished jobs to retain. Value must be non-negative integer. Defaults to 1. # noqa: E501 + + :param failed_jobs_history_limit: The failed_jobs_history_limit of this V1CronJobSpec. # noqa: E501 + :type failed_jobs_history_limit: int + """ + + self._failed_jobs_history_limit = failed_jobs_history_limit + + @property + def job_template(self): + """Gets the job_template of this V1CronJobSpec. # noqa: E501 + + + :return: The job_template of this V1CronJobSpec. # noqa: E501 + :rtype: V1JobTemplateSpec + """ + return self._job_template + + @job_template.setter + def job_template(self, job_template): + """Sets the job_template of this V1CronJobSpec. + + + :param job_template: The job_template of this V1CronJobSpec. # noqa: E501 + :type job_template: V1JobTemplateSpec + """ + if self.local_vars_configuration.client_side_validation and job_template is None: # noqa: E501 + raise ValueError("Invalid value for `job_template`, must not be `None`") # noqa: E501 + + self._job_template = job_template + + @property + def schedule(self): + """Gets the schedule of this V1CronJobSpec. # noqa: E501 + + The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. # noqa: E501 + + :return: The schedule of this V1CronJobSpec. # noqa: E501 + :rtype: str + """ + return self._schedule + + @schedule.setter + def schedule(self, schedule): + """Sets the schedule of this V1CronJobSpec. + + The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. # noqa: E501 + + :param schedule: The schedule of this V1CronJobSpec. # noqa: E501 + :type schedule: str + """ + if self.local_vars_configuration.client_side_validation and schedule is None: # noqa: E501 + raise ValueError("Invalid value for `schedule`, must not be `None`") # noqa: E501 + + self._schedule = schedule + + @property + def starting_deadline_seconds(self): + """Gets the starting_deadline_seconds of this V1CronJobSpec. # noqa: E501 + + Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones. # noqa: E501 + + :return: The starting_deadline_seconds of this V1CronJobSpec. # noqa: E501 + :rtype: int + """ + return self._starting_deadline_seconds + + @starting_deadline_seconds.setter + def starting_deadline_seconds(self, starting_deadline_seconds): + """Sets the starting_deadline_seconds of this V1CronJobSpec. + + Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones. # noqa: E501 + + :param starting_deadline_seconds: The starting_deadline_seconds of this V1CronJobSpec. # noqa: E501 + :type starting_deadline_seconds: int + """ + + self._starting_deadline_seconds = starting_deadline_seconds + + @property + def successful_jobs_history_limit(self): + """Gets the successful_jobs_history_limit of this V1CronJobSpec. # noqa: E501 + + The number of successful finished jobs to retain. Value must be non-negative integer. Defaults to 3. # noqa: E501 + + :return: The successful_jobs_history_limit of this V1CronJobSpec. # noqa: E501 + :rtype: int + """ + return self._successful_jobs_history_limit + + @successful_jobs_history_limit.setter + def successful_jobs_history_limit(self, successful_jobs_history_limit): + """Sets the successful_jobs_history_limit of this V1CronJobSpec. + + The number of successful finished jobs to retain. Value must be non-negative integer. Defaults to 3. # noqa: E501 + + :param successful_jobs_history_limit: The successful_jobs_history_limit of this V1CronJobSpec. # noqa: E501 + :type successful_jobs_history_limit: int + """ + + self._successful_jobs_history_limit = successful_jobs_history_limit + + @property + def suspend(self): + """Gets the suspend of this V1CronJobSpec. # noqa: E501 + + This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false. # noqa: E501 + + :return: The suspend of this V1CronJobSpec. # noqa: E501 + :rtype: bool + """ + return self._suspend + + @suspend.setter + def suspend(self, suspend): + """Sets the suspend of this V1CronJobSpec. + + This flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false. # noqa: E501 + + :param suspend: The suspend of this V1CronJobSpec. # noqa: E501 + :type suspend: bool + """ + + self._suspend = suspend + + @property + def time_zone(self): + """Gets the time_zone of this V1CronJobSpec. # noqa: E501 + + The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, this will default to the time zone of the kube-controller-manager process. The set of valid time zone names and the time zone offset is loaded from the system-wide time zone database by the API server during CronJob validation and the controller manager during execution. If no system-wide time zone database can be found a bundled version of the database is used instead. If the time zone name becomes invalid during the lifetime of a CronJob or due to a change in host configuration, the controller will stop creating new new Jobs and will create a system event with the reason UnknownTimeZone. More information can be found in https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones # noqa: E501 + + :return: The time_zone of this V1CronJobSpec. # noqa: E501 + :rtype: str + """ + return self._time_zone + + @time_zone.setter + def time_zone(self, time_zone): + """Sets the time_zone of this V1CronJobSpec. + + The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. If not specified, this will default to the time zone of the kube-controller-manager process. The set of valid time zone names and the time zone offset is loaded from the system-wide time zone database by the API server during CronJob validation and the controller manager during execution. If no system-wide time zone database can be found a bundled version of the database is used instead. If the time zone name becomes invalid during the lifetime of a CronJob or due to a change in host configuration, the controller will stop creating new new Jobs and will create a system event with the reason UnknownTimeZone. More information can be found in https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones # noqa: E501 + + :param time_zone: The time_zone of this V1CronJobSpec. # noqa: E501 + :type time_zone: str + """ + + self._time_zone = time_zone + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CronJobSpec): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CronJobSpec): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_cron_job_status.py b/kubernetes_asyncio/client/models/v1_cron_job_status.py new file mode 100644 index 0000000000..72ea5254bc --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_cron_job_status.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CronJobStatus(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'active': 'list[V1ObjectReference]', + 'last_schedule_time': 'datetime', + 'last_successful_time': 'datetime' + } + + attribute_map = { + 'active': 'active', + 'last_schedule_time': 'lastScheduleTime', + 'last_successful_time': 'lastSuccessfulTime' + } + + def __init__(self, active=None, last_schedule_time=None, last_successful_time=None, local_vars_configuration=None): # noqa: E501 + """V1CronJobStatus - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._active = None + self._last_schedule_time = None + self._last_successful_time = None + self.discriminator = None + + if active is not None: + self.active = active + if last_schedule_time is not None: + self.last_schedule_time = last_schedule_time + if last_successful_time is not None: + self.last_successful_time = last_successful_time + + @property + def active(self): + """Gets the active of this V1CronJobStatus. # noqa: E501 + + A list of pointers to currently running jobs. # noqa: E501 + + :return: The active of this V1CronJobStatus. # noqa: E501 + :rtype: list[V1ObjectReference] + """ + return self._active + + @active.setter + def active(self, active): + """Sets the active of this V1CronJobStatus. + + A list of pointers to currently running jobs. # noqa: E501 + + :param active: The active of this V1CronJobStatus. # noqa: E501 + :type active: list[V1ObjectReference] + """ + + self._active = active + + @property + def last_schedule_time(self): + """Gets the last_schedule_time of this V1CronJobStatus. # noqa: E501 + + Information when was the last time the job was successfully scheduled. # noqa: E501 + + :return: The last_schedule_time of this V1CronJobStatus. # noqa: E501 + :rtype: datetime + """ + return self._last_schedule_time + + @last_schedule_time.setter + def last_schedule_time(self, last_schedule_time): + """Sets the last_schedule_time of this V1CronJobStatus. + + Information when was the last time the job was successfully scheduled. # noqa: E501 + + :param last_schedule_time: The last_schedule_time of this V1CronJobStatus. # noqa: E501 + :type last_schedule_time: datetime + """ + + self._last_schedule_time = last_schedule_time + + @property + def last_successful_time(self): + """Gets the last_successful_time of this V1CronJobStatus. # noqa: E501 + + Information when was the last time the job successfully completed. # noqa: E501 + + :return: The last_successful_time of this V1CronJobStatus. # noqa: E501 + :rtype: datetime + """ + return self._last_successful_time + + @last_successful_time.setter + def last_successful_time(self, last_successful_time): + """Sets the last_successful_time of this V1CronJobStatus. + + Information when was the last time the job successfully completed. # noqa: E501 + + :param last_successful_time: The last_successful_time of this V1CronJobStatus. # noqa: E501 + :type last_successful_time: datetime + """ + + self._last_successful_time = last_successful_time + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CronJobStatus): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CronJobStatus): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_cross_version_object_reference.py b/kubernetes_asyncio/client/models/v1_cross_version_object_reference.py new file mode 100644 index 0000000000..98ff7ad723 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_cross_version_object_reference.py @@ -0,0 +1,191 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CrossVersionObjectReference(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'name': 'str' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'name': 'name' + } + + def __init__(self, api_version=None, kind=None, name=None, local_vars_configuration=None): # noqa: E501 + """V1CrossVersionObjectReference - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._name = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.kind = kind + self.name = name + + @property + def api_version(self): + """Gets the api_version of this V1CrossVersionObjectReference. # noqa: E501 + + apiVersion is the API version of the referent # noqa: E501 + + :return: The api_version of this V1CrossVersionObjectReference. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1CrossVersionObjectReference. + + apiVersion is the API version of the referent # noqa: E501 + + :param api_version: The api_version of this V1CrossVersionObjectReference. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1CrossVersionObjectReference. # noqa: E501 + + kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1CrossVersionObjectReference. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CrossVersionObjectReference. + + kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1CrossVersionObjectReference. # noqa: E501 + :type kind: str + """ + if self.local_vars_configuration.client_side_validation and kind is None: # noqa: E501 + raise ValueError("Invalid value for `kind`, must not be `None`") # noqa: E501 + + self._kind = kind + + @property + def name(self): + """Gets the name of this V1CrossVersionObjectReference. # noqa: E501 + + name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa: E501 + + :return: The name of this V1CrossVersionObjectReference. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1CrossVersionObjectReference. + + name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa: E501 + + :param name: The name of this V1CrossVersionObjectReference. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CrossVersionObjectReference): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CrossVersionObjectReference): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_csi_driver.py b/kubernetes_asyncio/client/models/v1_csi_driver.py new file mode 100644 index 0000000000..27ee780c96 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_csi_driver.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CSIDriver(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'spec': 'V1CSIDriverSpec' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'spec': 'spec' + } + + def __init__(self, api_version=None, kind=None, metadata=None, spec=None, local_vars_configuration=None): # noqa: E501 + """V1CSIDriver - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._metadata = None + self._spec = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + self.spec = spec + + @property + def api_version(self): + """Gets the api_version of this V1CSIDriver. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1CSIDriver. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1CSIDriver. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1CSIDriver. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1CSIDriver. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1CSIDriver. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CSIDriver. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1CSIDriver. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1CSIDriver. # noqa: E501 + + + :return: The metadata of this V1CSIDriver. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1CSIDriver. + + + :param metadata: The metadata of this V1CSIDriver. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def spec(self): + """Gets the spec of this V1CSIDriver. # noqa: E501 + + + :return: The spec of this V1CSIDriver. # noqa: E501 + :rtype: V1CSIDriverSpec + """ + return self._spec + + @spec.setter + def spec(self, spec): + """Sets the spec of this V1CSIDriver. + + + :param spec: The spec of this V1CSIDriver. # noqa: E501 + :type spec: V1CSIDriverSpec + """ + if self.local_vars_configuration.client_side_validation and spec is None: # noqa: E501 + raise ValueError("Invalid value for `spec`, must not be `None`") # noqa: E501 + + self._spec = spec + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CSIDriver): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CSIDriver): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_csi_driver_list.py b/kubernetes_asyncio/client/models/v1_csi_driver_list.py new file mode 100644 index 0000000000..8bc62c8370 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_csi_driver_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CSIDriverList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1CSIDriver]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1CSIDriverList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1CSIDriverList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1CSIDriverList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1CSIDriverList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1CSIDriverList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1CSIDriverList. # noqa: E501 + + items is the list of CSIDriver # noqa: E501 + + :return: The items of this V1CSIDriverList. # noqa: E501 + :rtype: list[V1CSIDriver] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1CSIDriverList. + + items is the list of CSIDriver # noqa: E501 + + :param items: The items of this V1CSIDriverList. # noqa: E501 + :type items: list[V1CSIDriver] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1CSIDriverList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1CSIDriverList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CSIDriverList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1CSIDriverList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1CSIDriverList. # noqa: E501 + + + :return: The metadata of this V1CSIDriverList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1CSIDriverList. + + + :param metadata: The metadata of this V1CSIDriverList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CSIDriverList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CSIDriverList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_csi_driver_spec.py b/kubernetes_asyncio/client/models/v1_csi_driver_spec.py new file mode 100644 index 0000000000..eba4bcba0c --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_csi_driver_spec.py @@ -0,0 +1,385 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CSIDriverSpec(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'attach_required': 'bool', + 'fs_group_policy': 'str', + 'node_allocatable_update_period_seconds': 'int', + 'pod_info_on_mount': 'bool', + 'requires_republish': 'bool', + 'se_linux_mount': 'bool', + 'service_account_token_in_secrets': 'bool', + 'storage_capacity': 'bool', + 'token_requests': 'list[StorageV1TokenRequest]', + 'volume_lifecycle_modes': 'list[str]' + } + + attribute_map = { + 'attach_required': 'attachRequired', + 'fs_group_policy': 'fsGroupPolicy', + 'node_allocatable_update_period_seconds': 'nodeAllocatableUpdatePeriodSeconds', + 'pod_info_on_mount': 'podInfoOnMount', + 'requires_republish': 'requiresRepublish', + 'se_linux_mount': 'seLinuxMount', + 'service_account_token_in_secrets': 'serviceAccountTokenInSecrets', + 'storage_capacity': 'storageCapacity', + 'token_requests': 'tokenRequests', + 'volume_lifecycle_modes': 'volumeLifecycleModes' + } + + def __init__(self, attach_required=None, fs_group_policy=None, node_allocatable_update_period_seconds=None, pod_info_on_mount=None, requires_republish=None, se_linux_mount=None, service_account_token_in_secrets=None, storage_capacity=None, token_requests=None, volume_lifecycle_modes=None, local_vars_configuration=None): # noqa: E501 + """V1CSIDriverSpec - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._attach_required = None + self._fs_group_policy = None + self._node_allocatable_update_period_seconds = None + self._pod_info_on_mount = None + self._requires_republish = None + self._se_linux_mount = None + self._service_account_token_in_secrets = None + self._storage_capacity = None + self._token_requests = None + self._volume_lifecycle_modes = None + self.discriminator = None + + if attach_required is not None: + self.attach_required = attach_required + if fs_group_policy is not None: + self.fs_group_policy = fs_group_policy + if node_allocatable_update_period_seconds is not None: + self.node_allocatable_update_period_seconds = node_allocatable_update_period_seconds + if pod_info_on_mount is not None: + self.pod_info_on_mount = pod_info_on_mount + if requires_republish is not None: + self.requires_republish = requires_republish + if se_linux_mount is not None: + self.se_linux_mount = se_linux_mount + if service_account_token_in_secrets is not None: + self.service_account_token_in_secrets = service_account_token_in_secrets + if storage_capacity is not None: + self.storage_capacity = storage_capacity + if token_requests is not None: + self.token_requests = token_requests + if volume_lifecycle_modes is not None: + self.volume_lifecycle_modes = volume_lifecycle_modes + + @property + def attach_required(self): + """Gets the attach_required of this V1CSIDriverSpec. # noqa: E501 + + attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called. This field is immutable. # noqa: E501 + + :return: The attach_required of this V1CSIDriverSpec. # noqa: E501 + :rtype: bool + """ + return self._attach_required + + @attach_required.setter + def attach_required(self, attach_required): + """Sets the attach_required of this V1CSIDriverSpec. + + attachRequired indicates this CSI volume driver requires an attach operation (because it implements the CSI ControllerPublishVolume() method), and that the Kubernetes attach detach controller should call the attach volume interface which checks the volumeattachment status and waits until the volume is attached before proceeding to mounting. The CSI external-attacher coordinates with CSI volume driver and updates the volumeattachment status when the attach operation is complete. If the value is specified to false, the attach operation will be skipped. Otherwise the attach operation will be called. This field is immutable. # noqa: E501 + + :param attach_required: The attach_required of this V1CSIDriverSpec. # noqa: E501 + :type attach_required: bool + """ + + self._attach_required = attach_required + + @property + def fs_group_policy(self): + """Gets the fs_group_policy of this V1CSIDriverSpec. # noqa: E501 + + fsGroupPolicy defines if the underlying volume supports changing ownership and permission of the volume before being mounted. Refer to the specific FSGroupPolicy values for additional details. This field was immutable in Kubernetes < 1.29 and now is mutable. Defaults to ReadWriteOnceWithFSType, which will examine each volume to determine if Kubernetes should modify ownership and permissions of the volume. With the default policy the defined fsGroup will only be applied if a fstype is defined and the volume's access mode contains ReadWriteOnce. # noqa: E501 + + :return: The fs_group_policy of this V1CSIDriverSpec. # noqa: E501 + :rtype: str + """ + return self._fs_group_policy + + @fs_group_policy.setter + def fs_group_policy(self, fs_group_policy): + """Sets the fs_group_policy of this V1CSIDriverSpec. + + fsGroupPolicy defines if the underlying volume supports changing ownership and permission of the volume before being mounted. Refer to the specific FSGroupPolicy values for additional details. This field was immutable in Kubernetes < 1.29 and now is mutable. Defaults to ReadWriteOnceWithFSType, which will examine each volume to determine if Kubernetes should modify ownership and permissions of the volume. With the default policy the defined fsGroup will only be applied if a fstype is defined and the volume's access mode contains ReadWriteOnce. # noqa: E501 + + :param fs_group_policy: The fs_group_policy of this V1CSIDriverSpec. # noqa: E501 + :type fs_group_policy: str + """ + + self._fs_group_policy = fs_group_policy + + @property + def node_allocatable_update_period_seconds(self): + """Gets the node_allocatable_update_period_seconds of this V1CSIDriverSpec. # noqa: E501 + + nodeAllocatableUpdatePeriodSeconds specifies the interval between periodic updates of the CSINode allocatable capacity for this driver. When set, both periodic updates and updates triggered by capacity-related failures are enabled. If not set, no updates occur (neither periodic nor upon detecting capacity-related failures), and the allocatable.count remains static. The minimum allowed value for this field is 10 seconds. This is a beta feature and requires the MutableCSINodeAllocatableCount feature gate to be enabled. This field is mutable. # noqa: E501 + + :return: The node_allocatable_update_period_seconds of this V1CSIDriverSpec. # noqa: E501 + :rtype: int + """ + return self._node_allocatable_update_period_seconds + + @node_allocatable_update_period_seconds.setter + def node_allocatable_update_period_seconds(self, node_allocatable_update_period_seconds): + """Sets the node_allocatable_update_period_seconds of this V1CSIDriverSpec. + + nodeAllocatableUpdatePeriodSeconds specifies the interval between periodic updates of the CSINode allocatable capacity for this driver. When set, both periodic updates and updates triggered by capacity-related failures are enabled. If not set, no updates occur (neither periodic nor upon detecting capacity-related failures), and the allocatable.count remains static. The minimum allowed value for this field is 10 seconds. This is a beta feature and requires the MutableCSINodeAllocatableCount feature gate to be enabled. This field is mutable. # noqa: E501 + + :param node_allocatable_update_period_seconds: The node_allocatable_update_period_seconds of this V1CSIDriverSpec. # noqa: E501 + :type node_allocatable_update_period_seconds: int + """ + + self._node_allocatable_update_period_seconds = node_allocatable_update_period_seconds + + @property + def pod_info_on_mount(self): + """Gets the pod_info_on_mount of this V1CSIDriverSpec. # noqa: E501 + + podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations, if set to true. If set to false, pod information will not be passed on mount. Default is false. The CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. The following VolumeContext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. \"csi.storage.k8s.io/pod.name\": pod.Name \"csi.storage.k8s.io/pod.namespace\": pod.Namespace \"csi.storage.k8s.io/pod.uid\": string(pod.UID) \"csi.storage.k8s.io/ephemeral\": \"true\" if the volume is an ephemeral inline volume defined by a CSIVolumeSource, otherwise \"false\" \"csi.storage.k8s.io/ephemeral\" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the \"Persistent\" and \"Ephemeral\" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver. This field was immutable in Kubernetes < 1.29 and now is mutable. # noqa: E501 + + :return: The pod_info_on_mount of this V1CSIDriverSpec. # noqa: E501 + :rtype: bool + """ + return self._pod_info_on_mount + + @pod_info_on_mount.setter + def pod_info_on_mount(self, pod_info_on_mount): + """Sets the pod_info_on_mount of this V1CSIDriverSpec. + + podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.) during mount operations, if set to true. If set to false, pod information will not be passed on mount. Default is false. The CSI driver specifies podInfoOnMount as part of driver deployment. If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls. The CSI driver is responsible for parsing and validating the information passed in as VolumeContext. The following VolumeContext will be passed if podInfoOnMount is set to true. This list might grow, but the prefix will be used. \"csi.storage.k8s.io/pod.name\": pod.Name \"csi.storage.k8s.io/pod.namespace\": pod.Namespace \"csi.storage.k8s.io/pod.uid\": string(pod.UID) \"csi.storage.k8s.io/ephemeral\": \"true\" if the volume is an ephemeral inline volume defined by a CSIVolumeSource, otherwise \"false\" \"csi.storage.k8s.io/ephemeral\" is a new feature in Kubernetes 1.16. It is only required for drivers which support both the \"Persistent\" and \"Ephemeral\" VolumeLifecycleMode. Other drivers can leave pod info disabled and/or ignore this field. As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when deployed on such a cluster and the deployment determines which mode that is, for example via a command line parameter of the driver. This field was immutable in Kubernetes < 1.29 and now is mutable. # noqa: E501 + + :param pod_info_on_mount: The pod_info_on_mount of this V1CSIDriverSpec. # noqa: E501 + :type pod_info_on_mount: bool + """ + + self._pod_info_on_mount = pod_info_on_mount + + @property + def requires_republish(self): + """Gets the requires_republish of this V1CSIDriverSpec. # noqa: E501 + + requiresRepublish indicates the CSI driver wants `NodePublishVolume` being periodically called to reflect any possible change in the mounted volume. This field defaults to false. Note: After a successful initial NodePublishVolume call, subsequent calls to NodePublishVolume should only update the contents of the volume. New mount points will not be seen by a running container. # noqa: E501 + + :return: The requires_republish of this V1CSIDriverSpec. # noqa: E501 + :rtype: bool + """ + return self._requires_republish + + @requires_republish.setter + def requires_republish(self, requires_republish): + """Sets the requires_republish of this V1CSIDriverSpec. + + requiresRepublish indicates the CSI driver wants `NodePublishVolume` being periodically called to reflect any possible change in the mounted volume. This field defaults to false. Note: After a successful initial NodePublishVolume call, subsequent calls to NodePublishVolume should only update the contents of the volume. New mount points will not be seen by a running container. # noqa: E501 + + :param requires_republish: The requires_republish of this V1CSIDriverSpec. # noqa: E501 + :type requires_republish: bool + """ + + self._requires_republish = requires_republish + + @property + def se_linux_mount(self): + """Gets the se_linux_mount of this V1CSIDriverSpec. # noqa: E501 + + seLinuxMount specifies if the CSI driver supports \"-o context\" mount option. When \"true\", the CSI driver must ensure that all volumes provided by this CSI driver can be mounted separately with different `-o context` options. This is typical for storage backends that provide volumes as filesystems on block devices or as independent shared volumes. Kubernetes will call NodeStage / NodePublish with \"-o context=xyz\" mount option when mounting a ReadWriteOncePod volume used in Pod that has explicitly set SELinux context. In the future, it may be expanded to other volume AccessModes. In any case, Kubernetes will ensure that the volume is mounted only with a single SELinux context. When \"false\", Kubernetes won't pass any special SELinux mount options to the driver. This is typical for volumes that represent subdirectories of a bigger shared filesystem. Default is \"false\". # noqa: E501 + + :return: The se_linux_mount of this V1CSIDriverSpec. # noqa: E501 + :rtype: bool + """ + return self._se_linux_mount + + @se_linux_mount.setter + def se_linux_mount(self, se_linux_mount): + """Sets the se_linux_mount of this V1CSIDriverSpec. + + seLinuxMount specifies if the CSI driver supports \"-o context\" mount option. When \"true\", the CSI driver must ensure that all volumes provided by this CSI driver can be mounted separately with different `-o context` options. This is typical for storage backends that provide volumes as filesystems on block devices or as independent shared volumes. Kubernetes will call NodeStage / NodePublish with \"-o context=xyz\" mount option when mounting a ReadWriteOncePod volume used in Pod that has explicitly set SELinux context. In the future, it may be expanded to other volume AccessModes. In any case, Kubernetes will ensure that the volume is mounted only with a single SELinux context. When \"false\", Kubernetes won't pass any special SELinux mount options to the driver. This is typical for volumes that represent subdirectories of a bigger shared filesystem. Default is \"false\". # noqa: E501 + + :param se_linux_mount: The se_linux_mount of this V1CSIDriverSpec. # noqa: E501 + :type se_linux_mount: bool + """ + + self._se_linux_mount = se_linux_mount + + @property + def service_account_token_in_secrets(self): + """Gets the service_account_token_in_secrets of this V1CSIDriverSpec. # noqa: E501 + + serviceAccountTokenInSecrets is an opt-in for CSI drivers to indicate that service account tokens should be passed via the Secrets field in NodePublishVolumeRequest instead of the VolumeContext field. The CSI specification provides a dedicated Secrets field for sensitive information like tokens, which is the appropriate mechanism for handling credentials. This addresses security concerns where sensitive tokens were being logged as part of volume context. When \"true\", kubelet will pass the tokens only in the Secrets field with the key \"csi.storage.k8s.io/serviceAccount.tokens\". The CSI driver must be updated to read tokens from the Secrets field instead of VolumeContext. When \"false\" or not set, kubelet will pass the tokens in VolumeContext with the key \"csi.storage.k8s.io/serviceAccount.tokens\" (existing behavior). This maintains backward compatibility with existing CSI drivers. This field can only be set when TokenRequests is configured. The API server will reject CSIDriver specs that set this field without TokenRequests. Default behavior if unset is to pass tokens in the VolumeContext field. # noqa: E501 + + :return: The service_account_token_in_secrets of this V1CSIDriverSpec. # noqa: E501 + :rtype: bool + """ + return self._service_account_token_in_secrets + + @service_account_token_in_secrets.setter + def service_account_token_in_secrets(self, service_account_token_in_secrets): + """Sets the service_account_token_in_secrets of this V1CSIDriverSpec. + + serviceAccountTokenInSecrets is an opt-in for CSI drivers to indicate that service account tokens should be passed via the Secrets field in NodePublishVolumeRequest instead of the VolumeContext field. The CSI specification provides a dedicated Secrets field for sensitive information like tokens, which is the appropriate mechanism for handling credentials. This addresses security concerns where sensitive tokens were being logged as part of volume context. When \"true\", kubelet will pass the tokens only in the Secrets field with the key \"csi.storage.k8s.io/serviceAccount.tokens\". The CSI driver must be updated to read tokens from the Secrets field instead of VolumeContext. When \"false\" or not set, kubelet will pass the tokens in VolumeContext with the key \"csi.storage.k8s.io/serviceAccount.tokens\" (existing behavior). This maintains backward compatibility with existing CSI drivers. This field can only be set when TokenRequests is configured. The API server will reject CSIDriver specs that set this field without TokenRequests. Default behavior if unset is to pass tokens in the VolumeContext field. # noqa: E501 + + :param service_account_token_in_secrets: The service_account_token_in_secrets of this V1CSIDriverSpec. # noqa: E501 + :type service_account_token_in_secrets: bool + """ + + self._service_account_token_in_secrets = service_account_token_in_secrets + + @property + def storage_capacity(self): + """Gets the storage_capacity of this V1CSIDriverSpec. # noqa: E501 + + storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage capacity that the driver deployment will report by creating CSIStorageCapacity objects with capacity information, if set to true. The check can be enabled immediately when deploying a driver. In that case, provisioning new volumes with late binding will pause until the driver deployment has published some suitable CSIStorageCapacity object. Alternatively, the driver can be deployed with the field unset or false and it can be flipped later when storage capacity information has been published. This field was immutable in Kubernetes <= 1.22 and now is mutable. # noqa: E501 + + :return: The storage_capacity of this V1CSIDriverSpec. # noqa: E501 + :rtype: bool + """ + return self._storage_capacity + + @storage_capacity.setter + def storage_capacity(self, storage_capacity): + """Sets the storage_capacity of this V1CSIDriverSpec. + + storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage capacity that the driver deployment will report by creating CSIStorageCapacity objects with capacity information, if set to true. The check can be enabled immediately when deploying a driver. In that case, provisioning new volumes with late binding will pause until the driver deployment has published some suitable CSIStorageCapacity object. Alternatively, the driver can be deployed with the field unset or false and it can be flipped later when storage capacity information has been published. This field was immutable in Kubernetes <= 1.22 and now is mutable. # noqa: E501 + + :param storage_capacity: The storage_capacity of this V1CSIDriverSpec. # noqa: E501 + :type storage_capacity: bool + """ + + self._storage_capacity = storage_capacity + + @property + def token_requests(self): + """Gets the token_requests of this V1CSIDriverSpec. # noqa: E501 + + tokenRequests indicates the CSI driver needs pods' service account tokens it is mounting volume for to do necessary authentication. Kubelet will pass the tokens in VolumeContext in the CSI NodePublishVolume calls. The CSI driver should parse and validate the following VolumeContext: \"csi.storage.k8s.io/serviceAccount.tokens\": { \"\": { \"token\": , \"expirationTimestamp\": , }, ... } Note: Audience in each TokenRequest should be different and at most one token is empty string. To receive a new token after expiry, RequiresRepublish can be used to trigger NodePublishVolume periodically. # noqa: E501 + + :return: The token_requests of this V1CSIDriverSpec. # noqa: E501 + :rtype: list[StorageV1TokenRequest] + """ + return self._token_requests + + @token_requests.setter + def token_requests(self, token_requests): + """Sets the token_requests of this V1CSIDriverSpec. + + tokenRequests indicates the CSI driver needs pods' service account tokens it is mounting volume for to do necessary authentication. Kubelet will pass the tokens in VolumeContext in the CSI NodePublishVolume calls. The CSI driver should parse and validate the following VolumeContext: \"csi.storage.k8s.io/serviceAccount.tokens\": { \"\": { \"token\": , \"expirationTimestamp\": , }, ... } Note: Audience in each TokenRequest should be different and at most one token is empty string. To receive a new token after expiry, RequiresRepublish can be used to trigger NodePublishVolume periodically. # noqa: E501 + + :param token_requests: The token_requests of this V1CSIDriverSpec. # noqa: E501 + :type token_requests: list[StorageV1TokenRequest] + """ + + self._token_requests = token_requests + + @property + def volume_lifecycle_modes(self): + """Gets the volume_lifecycle_modes of this V1CSIDriverSpec. # noqa: E501 + + volumeLifecycleModes defines what kind of volumes this CSI volume driver supports. The default if the list is empty is \"Persistent\", which is the usage defined by the CSI specification and implemented in Kubernetes via the usual PV/PVC mechanism. The other mode is \"Ephemeral\". In this mode, volumes are defined inline inside the pod spec with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod. A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume. For more information about implementing this mode, see https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html A driver can support one or more of these modes and more modes may be added in the future. This field is beta. This field is immutable. # noqa: E501 + + :return: The volume_lifecycle_modes of this V1CSIDriverSpec. # noqa: E501 + :rtype: list[str] + """ + return self._volume_lifecycle_modes + + @volume_lifecycle_modes.setter + def volume_lifecycle_modes(self, volume_lifecycle_modes): + """Sets the volume_lifecycle_modes of this V1CSIDriverSpec. + + volumeLifecycleModes defines what kind of volumes this CSI volume driver supports. The default if the list is empty is \"Persistent\", which is the usage defined by the CSI specification and implemented in Kubernetes via the usual PV/PVC mechanism. The other mode is \"Ephemeral\". In this mode, volumes are defined inline inside the pod spec with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod. A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume. For more information about implementing this mode, see https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html A driver can support one or more of these modes and more modes may be added in the future. This field is beta. This field is immutable. # noqa: E501 + + :param volume_lifecycle_modes: The volume_lifecycle_modes of this V1CSIDriverSpec. # noqa: E501 + :type volume_lifecycle_modes: list[str] + """ + + self._volume_lifecycle_modes = volume_lifecycle_modes + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CSIDriverSpec): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CSIDriverSpec): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_csi_node.py b/kubernetes_asyncio/client/models/v1_csi_node.py new file mode 100644 index 0000000000..229f42a2a9 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_csi_node.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CSINode(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'spec': 'V1CSINodeSpec' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'spec': 'spec' + } + + def __init__(self, api_version=None, kind=None, metadata=None, spec=None, local_vars_configuration=None): # noqa: E501 + """V1CSINode - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._metadata = None + self._spec = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + self.spec = spec + + @property + def api_version(self): + """Gets the api_version of this V1CSINode. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1CSINode. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1CSINode. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1CSINode. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1CSINode. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1CSINode. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CSINode. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1CSINode. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1CSINode. # noqa: E501 + + + :return: The metadata of this V1CSINode. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1CSINode. + + + :param metadata: The metadata of this V1CSINode. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def spec(self): + """Gets the spec of this V1CSINode. # noqa: E501 + + + :return: The spec of this V1CSINode. # noqa: E501 + :rtype: V1CSINodeSpec + """ + return self._spec + + @spec.setter + def spec(self, spec): + """Sets the spec of this V1CSINode. + + + :param spec: The spec of this V1CSINode. # noqa: E501 + :type spec: V1CSINodeSpec + """ + if self.local_vars_configuration.client_side_validation and spec is None: # noqa: E501 + raise ValueError("Invalid value for `spec`, must not be `None`") # noqa: E501 + + self._spec = spec + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CSINode): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CSINode): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_csi_node_driver.py b/kubernetes_asyncio/client/models/v1_csi_node_driver.py new file mode 100644 index 0000000000..1438e32271 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_csi_node_driver.py @@ -0,0 +1,217 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CSINodeDriver(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'allocatable': 'V1VolumeNodeResources', + 'name': 'str', + 'node_id': 'str', + 'topology_keys': 'list[str]' + } + + attribute_map = { + 'allocatable': 'allocatable', + 'name': 'name', + 'node_id': 'nodeID', + 'topology_keys': 'topologyKeys' + } + + def __init__(self, allocatable=None, name=None, node_id=None, topology_keys=None, local_vars_configuration=None): # noqa: E501 + """V1CSINodeDriver - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._allocatable = None + self._name = None + self._node_id = None + self._topology_keys = None + self.discriminator = None + + if allocatable is not None: + self.allocatable = allocatable + self.name = name + self.node_id = node_id + if topology_keys is not None: + self.topology_keys = topology_keys + + @property + def allocatable(self): + """Gets the allocatable of this V1CSINodeDriver. # noqa: E501 + + + :return: The allocatable of this V1CSINodeDriver. # noqa: E501 + :rtype: V1VolumeNodeResources + """ + return self._allocatable + + @allocatable.setter + def allocatable(self, allocatable): + """Sets the allocatable of this V1CSINodeDriver. + + + :param allocatable: The allocatable of this V1CSINodeDriver. # noqa: E501 + :type allocatable: V1VolumeNodeResources + """ + + self._allocatable = allocatable + + @property + def name(self): + """Gets the name of this V1CSINodeDriver. # noqa: E501 + + name represents the name of the CSI driver that this object refers to. This MUST be the same name returned by the CSI GetPluginName() call for that driver. # noqa: E501 + + :return: The name of this V1CSINodeDriver. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1CSINodeDriver. + + name represents the name of the CSI driver that this object refers to. This MUST be the same name returned by the CSI GetPluginName() call for that driver. # noqa: E501 + + :param name: The name of this V1CSINodeDriver. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def node_id(self): + """Gets the node_id of this V1CSINodeDriver. # noqa: E501 + + nodeID of the node from the driver point of view. This field enables Kubernetes to communicate with storage systems that do not share the same nomenclature for nodes. For example, Kubernetes may refer to a given node as \"node1\", but the storage system may refer to the same node as \"nodeA\". When Kubernetes issues a command to the storage system to attach a volume to a specific node, it can use this field to refer to the node name using the ID that the storage system will understand, e.g. \"nodeA\" instead of \"node1\". This field is required. # noqa: E501 + + :return: The node_id of this V1CSINodeDriver. # noqa: E501 + :rtype: str + """ + return self._node_id + + @node_id.setter + def node_id(self, node_id): + """Sets the node_id of this V1CSINodeDriver. + + nodeID of the node from the driver point of view. This field enables Kubernetes to communicate with storage systems that do not share the same nomenclature for nodes. For example, Kubernetes may refer to a given node as \"node1\", but the storage system may refer to the same node as \"nodeA\". When Kubernetes issues a command to the storage system to attach a volume to a specific node, it can use this field to refer to the node name using the ID that the storage system will understand, e.g. \"nodeA\" instead of \"node1\". This field is required. # noqa: E501 + + :param node_id: The node_id of this V1CSINodeDriver. # noqa: E501 + :type node_id: str + """ + if self.local_vars_configuration.client_side_validation and node_id is None: # noqa: E501 + raise ValueError("Invalid value for `node_id`, must not be `None`") # noqa: E501 + + self._node_id = node_id + + @property + def topology_keys(self): + """Gets the topology_keys of this V1CSINodeDriver. # noqa: E501 + + topologyKeys is the list of keys supported by the driver. When a driver is initialized on a cluster, it provides a set of topology keys that it understands (e.g. \"company.com/zone\", \"company.com/region\"). When a driver is initialized on a node, it provides the same topology keys along with values. Kubelet will expose these topology keys as labels on its own node object. When Kubernetes does topology aware provisioning, it can use this list to determine which labels it should retrieve from the node object and pass back to the driver. It is possible for different nodes to use different topology keys. This can be empty if driver does not support topology. # noqa: E501 + + :return: The topology_keys of this V1CSINodeDriver. # noqa: E501 + :rtype: list[str] + """ + return self._topology_keys + + @topology_keys.setter + def topology_keys(self, topology_keys): + """Sets the topology_keys of this V1CSINodeDriver. + + topologyKeys is the list of keys supported by the driver. When a driver is initialized on a cluster, it provides a set of topology keys that it understands (e.g. \"company.com/zone\", \"company.com/region\"). When a driver is initialized on a node, it provides the same topology keys along with values. Kubelet will expose these topology keys as labels on its own node object. When Kubernetes does topology aware provisioning, it can use this list to determine which labels it should retrieve from the node object and pass back to the driver. It is possible for different nodes to use different topology keys. This can be empty if driver does not support topology. # noqa: E501 + + :param topology_keys: The topology_keys of this V1CSINodeDriver. # noqa: E501 + :type topology_keys: list[str] + """ + + self._topology_keys = topology_keys + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CSINodeDriver): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CSINodeDriver): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_csi_node_list.py b/kubernetes_asyncio/client/models/v1_csi_node_list.py new file mode 100644 index 0000000000..dca1999b05 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_csi_node_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CSINodeList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1CSINode]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1CSINodeList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1CSINodeList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1CSINodeList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1CSINodeList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1CSINodeList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1CSINodeList. # noqa: E501 + + items is the list of CSINode # noqa: E501 + + :return: The items of this V1CSINodeList. # noqa: E501 + :rtype: list[V1CSINode] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1CSINodeList. + + items is the list of CSINode # noqa: E501 + + :param items: The items of this V1CSINodeList. # noqa: E501 + :type items: list[V1CSINode] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1CSINodeList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1CSINodeList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CSINodeList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1CSINodeList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1CSINodeList. # noqa: E501 + + + :return: The metadata of this V1CSINodeList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1CSINodeList. + + + :param metadata: The metadata of this V1CSINodeList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CSINodeList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CSINodeList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_csi_node_spec.py b/kubernetes_asyncio/client/models/v1_csi_node_spec.py new file mode 100644 index 0000000000..0436fab57a --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_csi_node_spec.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CSINodeSpec(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'drivers': 'list[V1CSINodeDriver]' + } + + attribute_map = { + 'drivers': 'drivers' + } + + def __init__(self, drivers=None, local_vars_configuration=None): # noqa: E501 + """V1CSINodeSpec - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._drivers = None + self.discriminator = None + + self.drivers = drivers + + @property + def drivers(self): + """Gets the drivers of this V1CSINodeSpec. # noqa: E501 + + drivers is a list of information of all CSI Drivers existing on a node. If all drivers in the list are uninstalled, this can become empty. # noqa: E501 + + :return: The drivers of this V1CSINodeSpec. # noqa: E501 + :rtype: list[V1CSINodeDriver] + """ + return self._drivers + + @drivers.setter + def drivers(self, drivers): + """Sets the drivers of this V1CSINodeSpec. + + drivers is a list of information of all CSI Drivers existing on a node. If all drivers in the list are uninstalled, this can become empty. # noqa: E501 + + :param drivers: The drivers of this V1CSINodeSpec. # noqa: E501 + :type drivers: list[V1CSINodeDriver] + """ + if self.local_vars_configuration.client_side_validation and drivers is None: # noqa: E501 + raise ValueError("Invalid value for `drivers`, must not be `None`") # noqa: E501 + + self._drivers = drivers + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CSINodeSpec): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CSINodeSpec): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_csi_persistent_volume_source.py b/kubernetes_asyncio/client/models/v1_csi_persistent_volume_source.py new file mode 100644 index 0000000000..e40fbde8b9 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_csi_persistent_volume_source.py @@ -0,0 +1,377 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CSIPersistentVolumeSource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'controller_expand_secret_ref': 'V1SecretReference', + 'controller_publish_secret_ref': 'V1SecretReference', + 'driver': 'str', + 'fs_type': 'str', + 'node_expand_secret_ref': 'V1SecretReference', + 'node_publish_secret_ref': 'V1SecretReference', + 'node_stage_secret_ref': 'V1SecretReference', + 'read_only': 'bool', + 'volume_attributes': 'dict[str, str]', + 'volume_handle': 'str' + } + + attribute_map = { + 'controller_expand_secret_ref': 'controllerExpandSecretRef', + 'controller_publish_secret_ref': 'controllerPublishSecretRef', + 'driver': 'driver', + 'fs_type': 'fsType', + 'node_expand_secret_ref': 'nodeExpandSecretRef', + 'node_publish_secret_ref': 'nodePublishSecretRef', + 'node_stage_secret_ref': 'nodeStageSecretRef', + 'read_only': 'readOnly', + 'volume_attributes': 'volumeAttributes', + 'volume_handle': 'volumeHandle' + } + + def __init__(self, controller_expand_secret_ref=None, controller_publish_secret_ref=None, driver=None, fs_type=None, node_expand_secret_ref=None, node_publish_secret_ref=None, node_stage_secret_ref=None, read_only=None, volume_attributes=None, volume_handle=None, local_vars_configuration=None): # noqa: E501 + """V1CSIPersistentVolumeSource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._controller_expand_secret_ref = None + self._controller_publish_secret_ref = None + self._driver = None + self._fs_type = None + self._node_expand_secret_ref = None + self._node_publish_secret_ref = None + self._node_stage_secret_ref = None + self._read_only = None + self._volume_attributes = None + self._volume_handle = None + self.discriminator = None + + if controller_expand_secret_ref is not None: + self.controller_expand_secret_ref = controller_expand_secret_ref + if controller_publish_secret_ref is not None: + self.controller_publish_secret_ref = controller_publish_secret_ref + self.driver = driver + if fs_type is not None: + self.fs_type = fs_type + if node_expand_secret_ref is not None: + self.node_expand_secret_ref = node_expand_secret_ref + if node_publish_secret_ref is not None: + self.node_publish_secret_ref = node_publish_secret_ref + if node_stage_secret_ref is not None: + self.node_stage_secret_ref = node_stage_secret_ref + if read_only is not None: + self.read_only = read_only + if volume_attributes is not None: + self.volume_attributes = volume_attributes + self.volume_handle = volume_handle + + @property + def controller_expand_secret_ref(self): + """Gets the controller_expand_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + + + :return: The controller_expand_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + :rtype: V1SecretReference + """ + return self._controller_expand_secret_ref + + @controller_expand_secret_ref.setter + def controller_expand_secret_ref(self, controller_expand_secret_ref): + """Sets the controller_expand_secret_ref of this V1CSIPersistentVolumeSource. + + + :param controller_expand_secret_ref: The controller_expand_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + :type controller_expand_secret_ref: V1SecretReference + """ + + self._controller_expand_secret_ref = controller_expand_secret_ref + + @property + def controller_publish_secret_ref(self): + """Gets the controller_publish_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + + + :return: The controller_publish_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + :rtype: V1SecretReference + """ + return self._controller_publish_secret_ref + + @controller_publish_secret_ref.setter + def controller_publish_secret_ref(self, controller_publish_secret_ref): + """Sets the controller_publish_secret_ref of this V1CSIPersistentVolumeSource. + + + :param controller_publish_secret_ref: The controller_publish_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + :type controller_publish_secret_ref: V1SecretReference + """ + + self._controller_publish_secret_ref = controller_publish_secret_ref + + @property + def driver(self): + """Gets the driver of this V1CSIPersistentVolumeSource. # noqa: E501 + + driver is the name of the driver to use for this volume. Required. # noqa: E501 + + :return: The driver of this V1CSIPersistentVolumeSource. # noqa: E501 + :rtype: str + """ + return self._driver + + @driver.setter + def driver(self, driver): + """Sets the driver of this V1CSIPersistentVolumeSource. + + driver is the name of the driver to use for this volume. Required. # noqa: E501 + + :param driver: The driver of this V1CSIPersistentVolumeSource. # noqa: E501 + :type driver: str + """ + if self.local_vars_configuration.client_side_validation and driver is None: # noqa: E501 + raise ValueError("Invalid value for `driver`, must not be `None`") # noqa: E501 + + self._driver = driver + + @property + def fs_type(self): + """Gets the fs_type of this V1CSIPersistentVolumeSource. # noqa: E501 + + fsType to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". # noqa: E501 + + :return: The fs_type of this V1CSIPersistentVolumeSource. # noqa: E501 + :rtype: str + """ + return self._fs_type + + @fs_type.setter + def fs_type(self, fs_type): + """Sets the fs_type of this V1CSIPersistentVolumeSource. + + fsType to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". # noqa: E501 + + :param fs_type: The fs_type of this V1CSIPersistentVolumeSource. # noqa: E501 + :type fs_type: str + """ + + self._fs_type = fs_type + + @property + def node_expand_secret_ref(self): + """Gets the node_expand_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + + + :return: The node_expand_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + :rtype: V1SecretReference + """ + return self._node_expand_secret_ref + + @node_expand_secret_ref.setter + def node_expand_secret_ref(self, node_expand_secret_ref): + """Sets the node_expand_secret_ref of this V1CSIPersistentVolumeSource. + + + :param node_expand_secret_ref: The node_expand_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + :type node_expand_secret_ref: V1SecretReference + """ + + self._node_expand_secret_ref = node_expand_secret_ref + + @property + def node_publish_secret_ref(self): + """Gets the node_publish_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + + + :return: The node_publish_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + :rtype: V1SecretReference + """ + return self._node_publish_secret_ref + + @node_publish_secret_ref.setter + def node_publish_secret_ref(self, node_publish_secret_ref): + """Sets the node_publish_secret_ref of this V1CSIPersistentVolumeSource. + + + :param node_publish_secret_ref: The node_publish_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + :type node_publish_secret_ref: V1SecretReference + """ + + self._node_publish_secret_ref = node_publish_secret_ref + + @property + def node_stage_secret_ref(self): + """Gets the node_stage_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + + + :return: The node_stage_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + :rtype: V1SecretReference + """ + return self._node_stage_secret_ref + + @node_stage_secret_ref.setter + def node_stage_secret_ref(self, node_stage_secret_ref): + """Sets the node_stage_secret_ref of this V1CSIPersistentVolumeSource. + + + :param node_stage_secret_ref: The node_stage_secret_ref of this V1CSIPersistentVolumeSource. # noqa: E501 + :type node_stage_secret_ref: V1SecretReference + """ + + self._node_stage_secret_ref = node_stage_secret_ref + + @property + def read_only(self): + """Gets the read_only of this V1CSIPersistentVolumeSource. # noqa: E501 + + readOnly value to pass to ControllerPublishVolumeRequest. Defaults to false (read/write). # noqa: E501 + + :return: The read_only of this V1CSIPersistentVolumeSource. # noqa: E501 + :rtype: bool + """ + return self._read_only + + @read_only.setter + def read_only(self, read_only): + """Sets the read_only of this V1CSIPersistentVolumeSource. + + readOnly value to pass to ControllerPublishVolumeRequest. Defaults to false (read/write). # noqa: E501 + + :param read_only: The read_only of this V1CSIPersistentVolumeSource. # noqa: E501 + :type read_only: bool + """ + + self._read_only = read_only + + @property + def volume_attributes(self): + """Gets the volume_attributes of this V1CSIPersistentVolumeSource. # noqa: E501 + + volumeAttributes of the volume to publish. # noqa: E501 + + :return: The volume_attributes of this V1CSIPersistentVolumeSource. # noqa: E501 + :rtype: dict[str, str] + """ + return self._volume_attributes + + @volume_attributes.setter + def volume_attributes(self, volume_attributes): + """Sets the volume_attributes of this V1CSIPersistentVolumeSource. + + volumeAttributes of the volume to publish. # noqa: E501 + + :param volume_attributes: The volume_attributes of this V1CSIPersistentVolumeSource. # noqa: E501 + :type volume_attributes: dict[str, str] + """ + + self._volume_attributes = volume_attributes + + @property + def volume_handle(self): + """Gets the volume_handle of this V1CSIPersistentVolumeSource. # noqa: E501 + + volumeHandle is the unique volume name returned by the CSI volume plugin’s CreateVolume to refer to the volume on all subsequent calls. Required. # noqa: E501 + + :return: The volume_handle of this V1CSIPersistentVolumeSource. # noqa: E501 + :rtype: str + """ + return self._volume_handle + + @volume_handle.setter + def volume_handle(self, volume_handle): + """Sets the volume_handle of this V1CSIPersistentVolumeSource. + + volumeHandle is the unique volume name returned by the CSI volume plugin’s CreateVolume to refer to the volume on all subsequent calls. Required. # noqa: E501 + + :param volume_handle: The volume_handle of this V1CSIPersistentVolumeSource. # noqa: E501 + :type volume_handle: str + """ + if self.local_vars_configuration.client_side_validation and volume_handle is None: # noqa: E501 + raise ValueError("Invalid value for `volume_handle`, must not be `None`") # noqa: E501 + + self._volume_handle = volume_handle + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CSIPersistentVolumeSource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CSIPersistentVolumeSource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_csi_storage_capacity.py b/kubernetes_asyncio/client/models/v1_csi_storage_capacity.py new file mode 100644 index 0000000000..5c131d5e07 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_csi_storage_capacity.py @@ -0,0 +1,298 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CSIStorageCapacity(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'capacity': 'str', + 'kind': 'str', + 'maximum_volume_size': 'str', + 'metadata': 'V1ObjectMeta', + 'node_topology': 'V1LabelSelector', + 'storage_class_name': 'str' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'capacity': 'capacity', + 'kind': 'kind', + 'maximum_volume_size': 'maximumVolumeSize', + 'metadata': 'metadata', + 'node_topology': 'nodeTopology', + 'storage_class_name': 'storageClassName' + } + + def __init__(self, api_version=None, capacity=None, kind=None, maximum_volume_size=None, metadata=None, node_topology=None, storage_class_name=None, local_vars_configuration=None): # noqa: E501 + """V1CSIStorageCapacity - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._capacity = None + self._kind = None + self._maximum_volume_size = None + self._metadata = None + self._node_topology = None + self._storage_class_name = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if capacity is not None: + self.capacity = capacity + if kind is not None: + self.kind = kind + if maximum_volume_size is not None: + self.maximum_volume_size = maximum_volume_size + if metadata is not None: + self.metadata = metadata + if node_topology is not None: + self.node_topology = node_topology + self.storage_class_name = storage_class_name + + @property + def api_version(self): + """Gets the api_version of this V1CSIStorageCapacity. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1CSIStorageCapacity. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1CSIStorageCapacity. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1CSIStorageCapacity. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def capacity(self): + """Gets the capacity of this V1CSIStorageCapacity. # noqa: E501 + + capacity is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields. The semantic is currently (CSI spec 1.2) defined as: The available capacity, in bytes, of the storage that can be used to provision volumes. If not set, that information is currently unavailable. # noqa: E501 + + :return: The capacity of this V1CSIStorageCapacity. # noqa: E501 + :rtype: str + """ + return self._capacity + + @capacity.setter + def capacity(self, capacity): + """Sets the capacity of this V1CSIStorageCapacity. + + capacity is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields. The semantic is currently (CSI spec 1.2) defined as: The available capacity, in bytes, of the storage that can be used to provision volumes. If not set, that information is currently unavailable. # noqa: E501 + + :param capacity: The capacity of this V1CSIStorageCapacity. # noqa: E501 + :type capacity: str + """ + + self._capacity = capacity + + @property + def kind(self): + """Gets the kind of this V1CSIStorageCapacity. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1CSIStorageCapacity. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CSIStorageCapacity. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1CSIStorageCapacity. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def maximum_volume_size(self): + """Gets the maximum_volume_size of this V1CSIStorageCapacity. # noqa: E501 + + maximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields. This is defined since CSI spec 1.4.0 as the largest size that may be used in a CreateVolumeRequest.capacity_range.required_bytes field to create a volume with the same parameters as those in GetCapacityRequest. The corresponding value in the Kubernetes API is ResourceRequirements.Requests in a volume claim. # noqa: E501 + + :return: The maximum_volume_size of this V1CSIStorageCapacity. # noqa: E501 + :rtype: str + """ + return self._maximum_volume_size + + @maximum_volume_size.setter + def maximum_volume_size(self, maximum_volume_size): + """Sets the maximum_volume_size of this V1CSIStorageCapacity. + + maximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse for a GetCapacityRequest with topology and parameters that match the previous fields. This is defined since CSI spec 1.4.0 as the largest size that may be used in a CreateVolumeRequest.capacity_range.required_bytes field to create a volume with the same parameters as those in GetCapacityRequest. The corresponding value in the Kubernetes API is ResourceRequirements.Requests in a volume claim. # noqa: E501 + + :param maximum_volume_size: The maximum_volume_size of this V1CSIStorageCapacity. # noqa: E501 + :type maximum_volume_size: str + """ + + self._maximum_volume_size = maximum_volume_size + + @property + def metadata(self): + """Gets the metadata of this V1CSIStorageCapacity. # noqa: E501 + + + :return: The metadata of this V1CSIStorageCapacity. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1CSIStorageCapacity. + + + :param metadata: The metadata of this V1CSIStorageCapacity. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def node_topology(self): + """Gets the node_topology of this V1CSIStorageCapacity. # noqa: E501 + + + :return: The node_topology of this V1CSIStorageCapacity. # noqa: E501 + :rtype: V1LabelSelector + """ + return self._node_topology + + @node_topology.setter + def node_topology(self, node_topology): + """Sets the node_topology of this V1CSIStorageCapacity. + + + :param node_topology: The node_topology of this V1CSIStorageCapacity. # noqa: E501 + :type node_topology: V1LabelSelector + """ + + self._node_topology = node_topology + + @property + def storage_class_name(self): + """Gets the storage_class_name of this V1CSIStorageCapacity. # noqa: E501 + + storageClassName represents the name of the StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, the CSIStorageCapacity object is obsolete and should be removed by its creator. This field is immutable. # noqa: E501 + + :return: The storage_class_name of this V1CSIStorageCapacity. # noqa: E501 + :rtype: str + """ + return self._storage_class_name + + @storage_class_name.setter + def storage_class_name(self, storage_class_name): + """Sets the storage_class_name of this V1CSIStorageCapacity. + + storageClassName represents the name of the StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, the CSIStorageCapacity object is obsolete and should be removed by its creator. This field is immutable. # noqa: E501 + + :param storage_class_name: The storage_class_name of this V1CSIStorageCapacity. # noqa: E501 + :type storage_class_name: str + """ + if self.local_vars_configuration.client_side_validation and storage_class_name is None: # noqa: E501 + raise ValueError("Invalid value for `storage_class_name`, must not be `None`") # noqa: E501 + + self._storage_class_name = storage_class_name + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CSIStorageCapacity): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CSIStorageCapacity): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_csi_storage_capacity_list.py b/kubernetes_asyncio/client/models/v1_csi_storage_capacity_list.py new file mode 100644 index 0000000000..3fa576afa7 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_csi_storage_capacity_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CSIStorageCapacityList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1CSIStorageCapacity]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1CSIStorageCapacityList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1CSIStorageCapacityList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1CSIStorageCapacityList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1CSIStorageCapacityList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1CSIStorageCapacityList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1CSIStorageCapacityList. # noqa: E501 + + items is the list of CSIStorageCapacity objects. # noqa: E501 + + :return: The items of this V1CSIStorageCapacityList. # noqa: E501 + :rtype: list[V1CSIStorageCapacity] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1CSIStorageCapacityList. + + items is the list of CSIStorageCapacity objects. # noqa: E501 + + :param items: The items of this V1CSIStorageCapacityList. # noqa: E501 + :type items: list[V1CSIStorageCapacity] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1CSIStorageCapacityList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1CSIStorageCapacityList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CSIStorageCapacityList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1CSIStorageCapacityList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1CSIStorageCapacityList. # noqa: E501 + + + :return: The metadata of this V1CSIStorageCapacityList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1CSIStorageCapacityList. + + + :param metadata: The metadata of this V1CSIStorageCapacityList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CSIStorageCapacityList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CSIStorageCapacityList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_csi_volume_source.py b/kubernetes_asyncio/client/models/v1_csi_volume_source.py new file mode 100644 index 0000000000..2f7708c7f7 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_csi_volume_source.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CSIVolumeSource(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'driver': 'str', + 'fs_type': 'str', + 'node_publish_secret_ref': 'V1LocalObjectReference', + 'read_only': 'bool', + 'volume_attributes': 'dict[str, str]' + } + + attribute_map = { + 'driver': 'driver', + 'fs_type': 'fsType', + 'node_publish_secret_ref': 'nodePublishSecretRef', + 'read_only': 'readOnly', + 'volume_attributes': 'volumeAttributes' + } + + def __init__(self, driver=None, fs_type=None, node_publish_secret_ref=None, read_only=None, volume_attributes=None, local_vars_configuration=None): # noqa: E501 + """V1CSIVolumeSource - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._driver = None + self._fs_type = None + self._node_publish_secret_ref = None + self._read_only = None + self._volume_attributes = None + self.discriminator = None + + self.driver = driver + if fs_type is not None: + self.fs_type = fs_type + if node_publish_secret_ref is not None: + self.node_publish_secret_ref = node_publish_secret_ref + if read_only is not None: + self.read_only = read_only + if volume_attributes is not None: + self.volume_attributes = volume_attributes + + @property + def driver(self): + """Gets the driver of this V1CSIVolumeSource. # noqa: E501 + + driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. # noqa: E501 + + :return: The driver of this V1CSIVolumeSource. # noqa: E501 + :rtype: str + """ + return self._driver + + @driver.setter + def driver(self, driver): + """Sets the driver of this V1CSIVolumeSource. + + driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. # noqa: E501 + + :param driver: The driver of this V1CSIVolumeSource. # noqa: E501 + :type driver: str + """ + if self.local_vars_configuration.client_side_validation and driver is None: # noqa: E501 + raise ValueError("Invalid value for `driver`, must not be `None`") # noqa: E501 + + self._driver = driver + + @property + def fs_type(self): + """Gets the fs_type of this V1CSIVolumeSource. # noqa: E501 + + fsType to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply. # noqa: E501 + + :return: The fs_type of this V1CSIVolumeSource. # noqa: E501 + :rtype: str + """ + return self._fs_type + + @fs_type.setter + def fs_type(self, fs_type): + """Sets the fs_type of this V1CSIVolumeSource. + + fsType to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply. # noqa: E501 + + :param fs_type: The fs_type of this V1CSIVolumeSource. # noqa: E501 + :type fs_type: str + """ + + self._fs_type = fs_type + + @property + def node_publish_secret_ref(self): + """Gets the node_publish_secret_ref of this V1CSIVolumeSource. # noqa: E501 + + + :return: The node_publish_secret_ref of this V1CSIVolumeSource. # noqa: E501 + :rtype: V1LocalObjectReference + """ + return self._node_publish_secret_ref + + @node_publish_secret_ref.setter + def node_publish_secret_ref(self, node_publish_secret_ref): + """Sets the node_publish_secret_ref of this V1CSIVolumeSource. + + + :param node_publish_secret_ref: The node_publish_secret_ref of this V1CSIVolumeSource. # noqa: E501 + :type node_publish_secret_ref: V1LocalObjectReference + """ + + self._node_publish_secret_ref = node_publish_secret_ref + + @property + def read_only(self): + """Gets the read_only of this V1CSIVolumeSource. # noqa: E501 + + readOnly specifies a read-only configuration for the volume. Defaults to false (read/write). # noqa: E501 + + :return: The read_only of this V1CSIVolumeSource. # noqa: E501 + :rtype: bool + """ + return self._read_only + + @read_only.setter + def read_only(self, read_only): + """Sets the read_only of this V1CSIVolumeSource. + + readOnly specifies a read-only configuration for the volume. Defaults to false (read/write). # noqa: E501 + + :param read_only: The read_only of this V1CSIVolumeSource. # noqa: E501 + :type read_only: bool + """ + + self._read_only = read_only + + @property + def volume_attributes(self): + """Gets the volume_attributes of this V1CSIVolumeSource. # noqa: E501 + + volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. # noqa: E501 + + :return: The volume_attributes of this V1CSIVolumeSource. # noqa: E501 + :rtype: dict[str, str] + """ + return self._volume_attributes + + @volume_attributes.setter + def volume_attributes(self, volume_attributes): + """Sets the volume_attributes of this V1CSIVolumeSource. + + volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. # noqa: E501 + + :param volume_attributes: The volume_attributes of this V1CSIVolumeSource. # noqa: E501 + :type volume_attributes: dict[str, str] + """ + + self._volume_attributes = volume_attributes + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CSIVolumeSource): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CSIVolumeSource): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_custom_resource_column_definition.py b/kubernetes_asyncio/client/models/v1_custom_resource_column_definition.py new file mode 100644 index 0000000000..b5d1085750 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_custom_resource_column_definition.py @@ -0,0 +1,276 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CustomResourceColumnDefinition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'description': 'str', + 'format': 'str', + 'json_path': 'str', + 'name': 'str', + 'priority': 'int', + 'type': 'str' + } + + attribute_map = { + 'description': 'description', + 'format': 'format', + 'json_path': 'jsonPath', + 'name': 'name', + 'priority': 'priority', + 'type': 'type' + } + + def __init__(self, description=None, format=None, json_path=None, name=None, priority=None, type=None, local_vars_configuration=None): # noqa: E501 + """V1CustomResourceColumnDefinition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._description = None + self._format = None + self._json_path = None + self._name = None + self._priority = None + self._type = None + self.discriminator = None + + if description is not None: + self.description = description + if format is not None: + self.format = format + self.json_path = json_path + self.name = name + if priority is not None: + self.priority = priority + self.type = type + + @property + def description(self): + """Gets the description of this V1CustomResourceColumnDefinition. # noqa: E501 + + description is a human readable description of this column. # noqa: E501 + + :return: The description of this V1CustomResourceColumnDefinition. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this V1CustomResourceColumnDefinition. + + description is a human readable description of this column. # noqa: E501 + + :param description: The description of this V1CustomResourceColumnDefinition. # noqa: E501 + :type description: str + """ + + self._description = description + + @property + def format(self): + """Gets the format of this V1CustomResourceColumnDefinition. # noqa: E501 + + format is an optional OpenAPI type definition for this column. The 'name' format is applied to the primary identifier column to assist in clients identifying column is the resource name. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. # noqa: E501 + + :return: The format of this V1CustomResourceColumnDefinition. # noqa: E501 + :rtype: str + """ + return self._format + + @format.setter + def format(self, format): + """Sets the format of this V1CustomResourceColumnDefinition. + + format is an optional OpenAPI type definition for this column. The 'name' format is applied to the primary identifier column to assist in clients identifying column is the resource name. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. # noqa: E501 + + :param format: The format of this V1CustomResourceColumnDefinition. # noqa: E501 + :type format: str + """ + + self._format = format + + @property + def json_path(self): + """Gets the json_path of this V1CustomResourceColumnDefinition. # noqa: E501 + + jsonPath is a simple JSON path (i.e. with array notation) which is evaluated against each custom resource to produce the value for this column. # noqa: E501 + + :return: The json_path of this V1CustomResourceColumnDefinition. # noqa: E501 + :rtype: str + """ + return self._json_path + + @json_path.setter + def json_path(self, json_path): + """Sets the json_path of this V1CustomResourceColumnDefinition. + + jsonPath is a simple JSON path (i.e. with array notation) which is evaluated against each custom resource to produce the value for this column. # noqa: E501 + + :param json_path: The json_path of this V1CustomResourceColumnDefinition. # noqa: E501 + :type json_path: str + """ + if self.local_vars_configuration.client_side_validation and json_path is None: # noqa: E501 + raise ValueError("Invalid value for `json_path`, must not be `None`") # noqa: E501 + + self._json_path = json_path + + @property + def name(self): + """Gets the name of this V1CustomResourceColumnDefinition. # noqa: E501 + + name is a human readable name for the column. # noqa: E501 + + :return: The name of this V1CustomResourceColumnDefinition. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1CustomResourceColumnDefinition. + + name is a human readable name for the column. # noqa: E501 + + :param name: The name of this V1CustomResourceColumnDefinition. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def priority(self): + """Gets the priority of this V1CustomResourceColumnDefinition. # noqa: E501 + + priority is an integer defining the relative importance of this column compared to others. Lower numbers are considered higher priority. Columns that may be omitted in limited space scenarios should be given a priority greater than 0. # noqa: E501 + + :return: The priority of this V1CustomResourceColumnDefinition. # noqa: E501 + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this V1CustomResourceColumnDefinition. + + priority is an integer defining the relative importance of this column compared to others. Lower numbers are considered higher priority. Columns that may be omitted in limited space scenarios should be given a priority greater than 0. # noqa: E501 + + :param priority: The priority of this V1CustomResourceColumnDefinition. # noqa: E501 + :type priority: int + """ + + self._priority = priority + + @property + def type(self): + """Gets the type of this V1CustomResourceColumnDefinition. # noqa: E501 + + type is an OpenAPI type definition for this column. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. # noqa: E501 + + :return: The type of this V1CustomResourceColumnDefinition. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this V1CustomResourceColumnDefinition. + + type is an OpenAPI type definition for this column. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details. # noqa: E501 + + :param type: The type of this V1CustomResourceColumnDefinition. # noqa: E501 + :type type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CustomResourceColumnDefinition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CustomResourceColumnDefinition): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_custom_resource_conversion.py b/kubernetes_asyncio/client/models/v1_custom_resource_conversion.py new file mode 100644 index 0000000000..1e6f64bffc --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_custom_resource_conversion.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CustomResourceConversion(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'strategy': 'str', + 'webhook': 'V1WebhookConversion' + } + + attribute_map = { + 'strategy': 'strategy', + 'webhook': 'webhook' + } + + def __init__(self, strategy=None, webhook=None, local_vars_configuration=None): # noqa: E501 + """V1CustomResourceConversion - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._strategy = None + self._webhook = None + self.discriminator = None + + self.strategy = strategy + if webhook is not None: + self.webhook = webhook + + @property + def strategy(self): + """Gets the strategy of this V1CustomResourceConversion. # noqa: E501 + + strategy specifies how custom resources are converted between versions. Allowed values are: - `\"None\"`: The converter only change the apiVersion and would not touch any other field in the custom resource. - `\"Webhook\"`: API Server will call to an external webhook to do the conversion. Additional information is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhook to be set. # noqa: E501 + + :return: The strategy of this V1CustomResourceConversion. # noqa: E501 + :rtype: str + """ + return self._strategy + + @strategy.setter + def strategy(self, strategy): + """Sets the strategy of this V1CustomResourceConversion. + + strategy specifies how custom resources are converted between versions. Allowed values are: - `\"None\"`: The converter only change the apiVersion and would not touch any other field in the custom resource. - `\"Webhook\"`: API Server will call to an external webhook to do the conversion. Additional information is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhook to be set. # noqa: E501 + + :param strategy: The strategy of this V1CustomResourceConversion. # noqa: E501 + :type strategy: str + """ + if self.local_vars_configuration.client_side_validation and strategy is None: # noqa: E501 + raise ValueError("Invalid value for `strategy`, must not be `None`") # noqa: E501 + + self._strategy = strategy + + @property + def webhook(self): + """Gets the webhook of this V1CustomResourceConversion. # noqa: E501 + + + :return: The webhook of this V1CustomResourceConversion. # noqa: E501 + :rtype: V1WebhookConversion + """ + return self._webhook + + @webhook.setter + def webhook(self, webhook): + """Sets the webhook of this V1CustomResourceConversion. + + + :param webhook: The webhook of this V1CustomResourceConversion. # noqa: E501 + :type webhook: V1WebhookConversion + """ + + self._webhook = webhook + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CustomResourceConversion): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CustomResourceConversion): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_custom_resource_definition.py b/kubernetes_asyncio/client/models/v1_custom_resource_definition.py new file mode 100644 index 0000000000..fc39e0921f --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_custom_resource_definition.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CustomResourceDefinition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'spec': 'V1CustomResourceDefinitionSpec', + 'status': 'V1CustomResourceDefinitionStatus' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'spec': 'spec', + 'status': 'status' + } + + def __init__(self, api_version=None, kind=None, metadata=None, spec=None, status=None, local_vars_configuration=None): # noqa: E501 + """V1CustomResourceDefinition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._metadata = None + self._spec = None + self._status = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + self.spec = spec + if status is not None: + self.status = status + + @property + def api_version(self): + """Gets the api_version of this V1CustomResourceDefinition. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1CustomResourceDefinition. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1CustomResourceDefinition. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1CustomResourceDefinition. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1CustomResourceDefinition. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1CustomResourceDefinition. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CustomResourceDefinition. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1CustomResourceDefinition. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1CustomResourceDefinition. # noqa: E501 + + + :return: The metadata of this V1CustomResourceDefinition. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1CustomResourceDefinition. + + + :param metadata: The metadata of this V1CustomResourceDefinition. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def spec(self): + """Gets the spec of this V1CustomResourceDefinition. # noqa: E501 + + + :return: The spec of this V1CustomResourceDefinition. # noqa: E501 + :rtype: V1CustomResourceDefinitionSpec + """ + return self._spec + + @spec.setter + def spec(self, spec): + """Sets the spec of this V1CustomResourceDefinition. + + + :param spec: The spec of this V1CustomResourceDefinition. # noqa: E501 + :type spec: V1CustomResourceDefinitionSpec + """ + if self.local_vars_configuration.client_side_validation and spec is None: # noqa: E501 + raise ValueError("Invalid value for `spec`, must not be `None`") # noqa: E501 + + self._spec = spec + + @property + def status(self): + """Gets the status of this V1CustomResourceDefinition. # noqa: E501 + + + :return: The status of this V1CustomResourceDefinition. # noqa: E501 + :rtype: V1CustomResourceDefinitionStatus + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1CustomResourceDefinition. + + + :param status: The status of this V1CustomResourceDefinition. # noqa: E501 + :type status: V1CustomResourceDefinitionStatus + """ + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CustomResourceDefinition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CustomResourceDefinition): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_custom_resource_definition_condition.py b/kubernetes_asyncio/client/models/v1_custom_resource_definition_condition.py new file mode 100644 index 0000000000..31123965e2 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_custom_resource_definition_condition.py @@ -0,0 +1,275 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CustomResourceDefinitionCondition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'last_transition_time': 'datetime', + 'message': 'str', + 'observed_generation': 'int', + 'reason': 'str', + 'status': 'str', + 'type': 'str' + } + + attribute_map = { + 'last_transition_time': 'lastTransitionTime', + 'message': 'message', + 'observed_generation': 'observedGeneration', + 'reason': 'reason', + 'status': 'status', + 'type': 'type' + } + + def __init__(self, last_transition_time=None, message=None, observed_generation=None, reason=None, status=None, type=None, local_vars_configuration=None): # noqa: E501 + """V1CustomResourceDefinitionCondition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._last_transition_time = None + self._message = None + self._observed_generation = None + self._reason = None + self._status = None + self._type = None + self.discriminator = None + + if last_transition_time is not None: + self.last_transition_time = last_transition_time + if message is not None: + self.message = message + if observed_generation is not None: + self.observed_generation = observed_generation + if reason is not None: + self.reason = reason + self.status = status + self.type = type + + @property + def last_transition_time(self): + """Gets the last_transition_time of this V1CustomResourceDefinitionCondition. # noqa: E501 + + lastTransitionTime last time the condition transitioned from one status to another. # noqa: E501 + + :return: The last_transition_time of this V1CustomResourceDefinitionCondition. # noqa: E501 + :rtype: datetime + """ + return self._last_transition_time + + @last_transition_time.setter + def last_transition_time(self, last_transition_time): + """Sets the last_transition_time of this V1CustomResourceDefinitionCondition. + + lastTransitionTime last time the condition transitioned from one status to another. # noqa: E501 + + :param last_transition_time: The last_transition_time of this V1CustomResourceDefinitionCondition. # noqa: E501 + :type last_transition_time: datetime + """ + + self._last_transition_time = last_transition_time + + @property + def message(self): + """Gets the message of this V1CustomResourceDefinitionCondition. # noqa: E501 + + message is a human-readable message indicating details about last transition. # noqa: E501 + + :return: The message of this V1CustomResourceDefinitionCondition. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this V1CustomResourceDefinitionCondition. + + message is a human-readable message indicating details about last transition. # noqa: E501 + + :param message: The message of this V1CustomResourceDefinitionCondition. # noqa: E501 + :type message: str + """ + + self._message = message + + @property + def observed_generation(self): + """Gets the observed_generation of this V1CustomResourceDefinitionCondition. # noqa: E501 + + observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. # noqa: E501 + + :return: The observed_generation of this V1CustomResourceDefinitionCondition. # noqa: E501 + :rtype: int + """ + return self._observed_generation + + @observed_generation.setter + def observed_generation(self, observed_generation): + """Sets the observed_generation of this V1CustomResourceDefinitionCondition. + + observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. # noqa: E501 + + :param observed_generation: The observed_generation of this V1CustomResourceDefinitionCondition. # noqa: E501 + :type observed_generation: int + """ + + self._observed_generation = observed_generation + + @property + def reason(self): + """Gets the reason of this V1CustomResourceDefinitionCondition. # noqa: E501 + + reason is a unique, one-word, CamelCase reason for the condition's last transition. # noqa: E501 + + :return: The reason of this V1CustomResourceDefinitionCondition. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this V1CustomResourceDefinitionCondition. + + reason is a unique, one-word, CamelCase reason for the condition's last transition. # noqa: E501 + + :param reason: The reason of this V1CustomResourceDefinitionCondition. # noqa: E501 + :type reason: str + """ + + self._reason = reason + + @property + def status(self): + """Gets the status of this V1CustomResourceDefinitionCondition. # noqa: E501 + + status is the status of the condition. Can be True, False, Unknown. # noqa: E501 + + :return: The status of this V1CustomResourceDefinitionCondition. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1CustomResourceDefinitionCondition. + + status is the status of the condition. Can be True, False, Unknown. # noqa: E501 + + :param status: The status of this V1CustomResourceDefinitionCondition. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def type(self): + """Gets the type of this V1CustomResourceDefinitionCondition. # noqa: E501 + + type is the type of the condition. Types include Established, NamesAccepted and Terminating. # noqa: E501 + + :return: The type of this V1CustomResourceDefinitionCondition. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this V1CustomResourceDefinitionCondition. + + type is the type of the condition. Types include Established, NamesAccepted and Terminating. # noqa: E501 + + :param type: The type of this V1CustomResourceDefinitionCondition. # noqa: E501 + :type type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CustomResourceDefinitionCondition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CustomResourceDefinitionCondition): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_custom_resource_definition_list.py b/kubernetes_asyncio/client/models/v1_custom_resource_definition_list.py new file mode 100644 index 0000000000..fa4a14b003 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_custom_resource_definition_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CustomResourceDefinitionList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1CustomResourceDefinition]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1CustomResourceDefinitionList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1CustomResourceDefinitionList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1CustomResourceDefinitionList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1CustomResourceDefinitionList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1CustomResourceDefinitionList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1CustomResourceDefinitionList. # noqa: E501 + + items list individual CustomResourceDefinition objects # noqa: E501 + + :return: The items of this V1CustomResourceDefinitionList. # noqa: E501 + :rtype: list[V1CustomResourceDefinition] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1CustomResourceDefinitionList. + + items list individual CustomResourceDefinition objects # noqa: E501 + + :param items: The items of this V1CustomResourceDefinitionList. # noqa: E501 + :type items: list[V1CustomResourceDefinition] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1CustomResourceDefinitionList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1CustomResourceDefinitionList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CustomResourceDefinitionList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1CustomResourceDefinitionList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1CustomResourceDefinitionList. # noqa: E501 + + + :return: The metadata of this V1CustomResourceDefinitionList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1CustomResourceDefinitionList. + + + :param metadata: The metadata of this V1CustomResourceDefinitionList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CustomResourceDefinitionList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CustomResourceDefinitionList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_custom_resource_definition_names.py b/kubernetes_asyncio/client/models/v1_custom_resource_definition_names.py new file mode 100644 index 0000000000..ab89588982 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_custom_resource_definition_names.py @@ -0,0 +1,275 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CustomResourceDefinitionNames(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'categories': 'list[str]', + 'kind': 'str', + 'list_kind': 'str', + 'plural': 'str', + 'short_names': 'list[str]', + 'singular': 'str' + } + + attribute_map = { + 'categories': 'categories', + 'kind': 'kind', + 'list_kind': 'listKind', + 'plural': 'plural', + 'short_names': 'shortNames', + 'singular': 'singular' + } + + def __init__(self, categories=None, kind=None, list_kind=None, plural=None, short_names=None, singular=None, local_vars_configuration=None): # noqa: E501 + """V1CustomResourceDefinitionNames - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._categories = None + self._kind = None + self._list_kind = None + self._plural = None + self._short_names = None + self._singular = None + self.discriminator = None + + if categories is not None: + self.categories = categories + self.kind = kind + if list_kind is not None: + self.list_kind = list_kind + self.plural = plural + if short_names is not None: + self.short_names = short_names + if singular is not None: + self.singular = singular + + @property + def categories(self): + """Gets the categories of this V1CustomResourceDefinitionNames. # noqa: E501 + + categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). This is published in API discovery documents, and used by clients to support invocations like `kubectl get all`. # noqa: E501 + + :return: The categories of this V1CustomResourceDefinitionNames. # noqa: E501 + :rtype: list[str] + """ + return self._categories + + @categories.setter + def categories(self, categories): + """Sets the categories of this V1CustomResourceDefinitionNames. + + categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). This is published in API discovery documents, and used by clients to support invocations like `kubectl get all`. # noqa: E501 + + :param categories: The categories of this V1CustomResourceDefinitionNames. # noqa: E501 + :type categories: list[str] + """ + + self._categories = categories + + @property + def kind(self): + """Gets the kind of this V1CustomResourceDefinitionNames. # noqa: E501 + + kind is the serialized kind of the resource. It is normally CamelCase and singular. Custom resource instances will use this value as the `kind` attribute in API calls. # noqa: E501 + + :return: The kind of this V1CustomResourceDefinitionNames. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1CustomResourceDefinitionNames. + + kind is the serialized kind of the resource. It is normally CamelCase and singular. Custom resource instances will use this value as the `kind` attribute in API calls. # noqa: E501 + + :param kind: The kind of this V1CustomResourceDefinitionNames. # noqa: E501 + :type kind: str + """ + if self.local_vars_configuration.client_side_validation and kind is None: # noqa: E501 + raise ValueError("Invalid value for `kind`, must not be `None`") # noqa: E501 + + self._kind = kind + + @property + def list_kind(self): + """Gets the list_kind of this V1CustomResourceDefinitionNames. # noqa: E501 + + listKind is the serialized kind of the list for this resource. Defaults to \"`kind`List\". # noqa: E501 + + :return: The list_kind of this V1CustomResourceDefinitionNames. # noqa: E501 + :rtype: str + """ + return self._list_kind + + @list_kind.setter + def list_kind(self, list_kind): + """Sets the list_kind of this V1CustomResourceDefinitionNames. + + listKind is the serialized kind of the list for this resource. Defaults to \"`kind`List\". # noqa: E501 + + :param list_kind: The list_kind of this V1CustomResourceDefinitionNames. # noqa: E501 + :type list_kind: str + """ + + self._list_kind = list_kind + + @property + def plural(self): + """Gets the plural of this V1CustomResourceDefinitionNames. # noqa: E501 + + plural is the plural name of the resource to serve. The custom resources are served under `/apis///.../`. Must match the name of the CustomResourceDefinition (in the form `.`). Must be all lowercase. # noqa: E501 + + :return: The plural of this V1CustomResourceDefinitionNames. # noqa: E501 + :rtype: str + """ + return self._plural + + @plural.setter + def plural(self, plural): + """Sets the plural of this V1CustomResourceDefinitionNames. + + plural is the plural name of the resource to serve. The custom resources are served under `/apis///.../`. Must match the name of the CustomResourceDefinition (in the form `.`). Must be all lowercase. # noqa: E501 + + :param plural: The plural of this V1CustomResourceDefinitionNames. # noqa: E501 + :type plural: str + """ + if self.local_vars_configuration.client_side_validation and plural is None: # noqa: E501 + raise ValueError("Invalid value for `plural`, must not be `None`") # noqa: E501 + + self._plural = plural + + @property + def short_names(self): + """Gets the short_names of this V1CustomResourceDefinitionNames. # noqa: E501 + + shortNames are short names for the resource, exposed in API discovery documents, and used by clients to support invocations like `kubectl get `. It must be all lowercase. # noqa: E501 + + :return: The short_names of this V1CustomResourceDefinitionNames. # noqa: E501 + :rtype: list[str] + """ + return self._short_names + + @short_names.setter + def short_names(self, short_names): + """Sets the short_names of this V1CustomResourceDefinitionNames. + + shortNames are short names for the resource, exposed in API discovery documents, and used by clients to support invocations like `kubectl get `. It must be all lowercase. # noqa: E501 + + :param short_names: The short_names of this V1CustomResourceDefinitionNames. # noqa: E501 + :type short_names: list[str] + """ + + self._short_names = short_names + + @property + def singular(self): + """Gets the singular of this V1CustomResourceDefinitionNames. # noqa: E501 + + singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`. # noqa: E501 + + :return: The singular of this V1CustomResourceDefinitionNames. # noqa: E501 + :rtype: str + """ + return self._singular + + @singular.setter + def singular(self, singular): + """Sets the singular of this V1CustomResourceDefinitionNames. + + singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`. # noqa: E501 + + :param singular: The singular of this V1CustomResourceDefinitionNames. # noqa: E501 + :type singular: str + """ + + self._singular = singular + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CustomResourceDefinitionNames): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CustomResourceDefinitionNames): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_custom_resource_definition_spec.py b/kubernetes_asyncio/client/models/v1_custom_resource_definition_spec.py new file mode 100644 index 0000000000..72ffdc3b73 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_custom_resource_definition_spec.py @@ -0,0 +1,273 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CustomResourceDefinitionSpec(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'conversion': 'V1CustomResourceConversion', + 'group': 'str', + 'names': 'V1CustomResourceDefinitionNames', + 'preserve_unknown_fields': 'bool', + 'scope': 'str', + 'versions': 'list[V1CustomResourceDefinitionVersion]' + } + + attribute_map = { + 'conversion': 'conversion', + 'group': 'group', + 'names': 'names', + 'preserve_unknown_fields': 'preserveUnknownFields', + 'scope': 'scope', + 'versions': 'versions' + } + + def __init__(self, conversion=None, group=None, names=None, preserve_unknown_fields=None, scope=None, versions=None, local_vars_configuration=None): # noqa: E501 + """V1CustomResourceDefinitionSpec - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._conversion = None + self._group = None + self._names = None + self._preserve_unknown_fields = None + self._scope = None + self._versions = None + self.discriminator = None + + if conversion is not None: + self.conversion = conversion + self.group = group + self.names = names + if preserve_unknown_fields is not None: + self.preserve_unknown_fields = preserve_unknown_fields + self.scope = scope + self.versions = versions + + @property + def conversion(self): + """Gets the conversion of this V1CustomResourceDefinitionSpec. # noqa: E501 + + + :return: The conversion of this V1CustomResourceDefinitionSpec. # noqa: E501 + :rtype: V1CustomResourceConversion + """ + return self._conversion + + @conversion.setter + def conversion(self, conversion): + """Sets the conversion of this V1CustomResourceDefinitionSpec. + + + :param conversion: The conversion of this V1CustomResourceDefinitionSpec. # noqa: E501 + :type conversion: V1CustomResourceConversion + """ + + self._conversion = conversion + + @property + def group(self): + """Gets the group of this V1CustomResourceDefinitionSpec. # noqa: E501 + + group is the API group of the defined custom resource. The custom resources are served under `/apis//...`. Must match the name of the CustomResourceDefinition (in the form `.`). # noqa: E501 + + :return: The group of this V1CustomResourceDefinitionSpec. # noqa: E501 + :rtype: str + """ + return self._group + + @group.setter + def group(self, group): + """Sets the group of this V1CustomResourceDefinitionSpec. + + group is the API group of the defined custom resource. The custom resources are served under `/apis//...`. Must match the name of the CustomResourceDefinition (in the form `.`). # noqa: E501 + + :param group: The group of this V1CustomResourceDefinitionSpec. # noqa: E501 + :type group: str + """ + if self.local_vars_configuration.client_side_validation and group is None: # noqa: E501 + raise ValueError("Invalid value for `group`, must not be `None`") # noqa: E501 + + self._group = group + + @property + def names(self): + """Gets the names of this V1CustomResourceDefinitionSpec. # noqa: E501 + + + :return: The names of this V1CustomResourceDefinitionSpec. # noqa: E501 + :rtype: V1CustomResourceDefinitionNames + """ + return self._names + + @names.setter + def names(self, names): + """Sets the names of this V1CustomResourceDefinitionSpec. + + + :param names: The names of this V1CustomResourceDefinitionSpec. # noqa: E501 + :type names: V1CustomResourceDefinitionNames + """ + if self.local_vars_configuration.client_side_validation and names is None: # noqa: E501 + raise ValueError("Invalid value for `names`, must not be `None`") # noqa: E501 + + self._names = names + + @property + def preserve_unknown_fields(self): + """Gets the preserve_unknown_fields of this V1CustomResourceDefinitionSpec. # noqa: E501 + + preserveUnknownFields indicates that object fields which are not specified in the OpenAPI schema should be preserved when persisting to storage. apiVersion, kind, metadata and known fields inside metadata are always preserved. This field is deprecated in favor of setting `x-preserve-unknown-fields` to true in `spec.versions[*].schema.openAPIV3Schema`. See https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-pruning for details. # noqa: E501 + + :return: The preserve_unknown_fields of this V1CustomResourceDefinitionSpec. # noqa: E501 + :rtype: bool + """ + return self._preserve_unknown_fields + + @preserve_unknown_fields.setter + def preserve_unknown_fields(self, preserve_unknown_fields): + """Sets the preserve_unknown_fields of this V1CustomResourceDefinitionSpec. + + preserveUnknownFields indicates that object fields which are not specified in the OpenAPI schema should be preserved when persisting to storage. apiVersion, kind, metadata and known fields inside metadata are always preserved. This field is deprecated in favor of setting `x-preserve-unknown-fields` to true in `spec.versions[*].schema.openAPIV3Schema`. See https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-pruning for details. # noqa: E501 + + :param preserve_unknown_fields: The preserve_unknown_fields of this V1CustomResourceDefinitionSpec. # noqa: E501 + :type preserve_unknown_fields: bool + """ + + self._preserve_unknown_fields = preserve_unknown_fields + + @property + def scope(self): + """Gets the scope of this V1CustomResourceDefinitionSpec. # noqa: E501 + + scope indicates whether the defined custom resource is cluster- or namespace-scoped. Allowed values are `Cluster` and `Namespaced`. # noqa: E501 + + :return: The scope of this V1CustomResourceDefinitionSpec. # noqa: E501 + :rtype: str + """ + return self._scope + + @scope.setter + def scope(self, scope): + """Sets the scope of this V1CustomResourceDefinitionSpec. + + scope indicates whether the defined custom resource is cluster- or namespace-scoped. Allowed values are `Cluster` and `Namespaced`. # noqa: E501 + + :param scope: The scope of this V1CustomResourceDefinitionSpec. # noqa: E501 + :type scope: str + """ + if self.local_vars_configuration.client_side_validation and scope is None: # noqa: E501 + raise ValueError("Invalid value for `scope`, must not be `None`") # noqa: E501 + + self._scope = scope + + @property + def versions(self): + """Gets the versions of this V1CustomResourceDefinitionSpec. # noqa: E501 + + versions is the list of all API versions of the defined custom resource. Version names are used to compute the order in which served versions are listed in API discovery. If the version string is \"kube-like\", it will sort above non \"kube-like\" version strings, which are ordered lexicographically. \"Kube-like\" versions start with a \"v\", then are followed by a number (the major version), then optionally the string \"alpha\" or \"beta\" and another number (the minor version). These are sorted first by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing major version, then minor version. An example sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10. # noqa: E501 + + :return: The versions of this V1CustomResourceDefinitionSpec. # noqa: E501 + :rtype: list[V1CustomResourceDefinitionVersion] + """ + return self._versions + + @versions.setter + def versions(self, versions): + """Sets the versions of this V1CustomResourceDefinitionSpec. + + versions is the list of all API versions of the defined custom resource. Version names are used to compute the order in which served versions are listed in API discovery. If the version string is \"kube-like\", it will sort above non \"kube-like\" version strings, which are ordered lexicographically. \"Kube-like\" versions start with a \"v\", then are followed by a number (the major version), then optionally the string \"alpha\" or \"beta\" and another number (the minor version). These are sorted first by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing major version, then minor version. An example sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10. # noqa: E501 + + :param versions: The versions of this V1CustomResourceDefinitionSpec. # noqa: E501 + :type versions: list[V1CustomResourceDefinitionVersion] + """ + if self.local_vars_configuration.client_side_validation and versions is None: # noqa: E501 + raise ValueError("Invalid value for `versions`, must not be `None`") # noqa: E501 + + self._versions = versions + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CustomResourceDefinitionSpec): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CustomResourceDefinitionSpec): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_custom_resource_definition_status.py b/kubernetes_asyncio/client/models/v1_custom_resource_definition_status.py new file mode 100644 index 0000000000..3cc417d752 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_custom_resource_definition_status.py @@ -0,0 +1,215 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CustomResourceDefinitionStatus(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'accepted_names': 'V1CustomResourceDefinitionNames', + 'conditions': 'list[V1CustomResourceDefinitionCondition]', + 'observed_generation': 'int', + 'stored_versions': 'list[str]' + } + + attribute_map = { + 'accepted_names': 'acceptedNames', + 'conditions': 'conditions', + 'observed_generation': 'observedGeneration', + 'stored_versions': 'storedVersions' + } + + def __init__(self, accepted_names=None, conditions=None, observed_generation=None, stored_versions=None, local_vars_configuration=None): # noqa: E501 + """V1CustomResourceDefinitionStatus - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._accepted_names = None + self._conditions = None + self._observed_generation = None + self._stored_versions = None + self.discriminator = None + + if accepted_names is not None: + self.accepted_names = accepted_names + if conditions is not None: + self.conditions = conditions + if observed_generation is not None: + self.observed_generation = observed_generation + if stored_versions is not None: + self.stored_versions = stored_versions + + @property + def accepted_names(self): + """Gets the accepted_names of this V1CustomResourceDefinitionStatus. # noqa: E501 + + + :return: The accepted_names of this V1CustomResourceDefinitionStatus. # noqa: E501 + :rtype: V1CustomResourceDefinitionNames + """ + return self._accepted_names + + @accepted_names.setter + def accepted_names(self, accepted_names): + """Sets the accepted_names of this V1CustomResourceDefinitionStatus. + + + :param accepted_names: The accepted_names of this V1CustomResourceDefinitionStatus. # noqa: E501 + :type accepted_names: V1CustomResourceDefinitionNames + """ + + self._accepted_names = accepted_names + + @property + def conditions(self): + """Gets the conditions of this V1CustomResourceDefinitionStatus. # noqa: E501 + + conditions indicate state for particular aspects of a CustomResourceDefinition # noqa: E501 + + :return: The conditions of this V1CustomResourceDefinitionStatus. # noqa: E501 + :rtype: list[V1CustomResourceDefinitionCondition] + """ + return self._conditions + + @conditions.setter + def conditions(self, conditions): + """Sets the conditions of this V1CustomResourceDefinitionStatus. + + conditions indicate state for particular aspects of a CustomResourceDefinition # noqa: E501 + + :param conditions: The conditions of this V1CustomResourceDefinitionStatus. # noqa: E501 + :type conditions: list[V1CustomResourceDefinitionCondition] + """ + + self._conditions = conditions + + @property + def observed_generation(self): + """Gets the observed_generation of this V1CustomResourceDefinitionStatus. # noqa: E501 + + The generation observed by the CRD controller. # noqa: E501 + + :return: The observed_generation of this V1CustomResourceDefinitionStatus. # noqa: E501 + :rtype: int + """ + return self._observed_generation + + @observed_generation.setter + def observed_generation(self, observed_generation): + """Sets the observed_generation of this V1CustomResourceDefinitionStatus. + + The generation observed by the CRD controller. # noqa: E501 + + :param observed_generation: The observed_generation of this V1CustomResourceDefinitionStatus. # noqa: E501 + :type observed_generation: int + """ + + self._observed_generation = observed_generation + + @property + def stored_versions(self): + """Gets the stored_versions of this V1CustomResourceDefinitionStatus. # noqa: E501 + + storedVersions lists all versions of CustomResources that were ever persisted. Tracking these versions allows a migration path for stored versions in etcd. The field is mutable so a migration controller can finish a migration to another version (ensuring no old objects are left in storage), and then remove the rest of the versions from this list. Versions may not be removed from `spec.versions` while they exist in this list. # noqa: E501 + + :return: The stored_versions of this V1CustomResourceDefinitionStatus. # noqa: E501 + :rtype: list[str] + """ + return self._stored_versions + + @stored_versions.setter + def stored_versions(self, stored_versions): + """Sets the stored_versions of this V1CustomResourceDefinitionStatus. + + storedVersions lists all versions of CustomResources that were ever persisted. Tracking these versions allows a migration path for stored versions in etcd. The field is mutable so a migration controller can finish a migration to another version (ensuring no old objects are left in storage), and then remove the rest of the versions from this list. Versions may not be removed from `spec.versions` while they exist in this list. # noqa: E501 + + :param stored_versions: The stored_versions of this V1CustomResourceDefinitionStatus. # noqa: E501 + :type stored_versions: list[str] + """ + + self._stored_versions = stored_versions + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CustomResourceDefinitionStatus): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CustomResourceDefinitionStatus): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_custom_resource_definition_version.py b/kubernetes_asyncio/client/models/v1_custom_resource_definition_version.py new file mode 100644 index 0000000000..73eda04e16 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_custom_resource_definition_version.py @@ -0,0 +1,356 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CustomResourceDefinitionVersion(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'additional_printer_columns': 'list[V1CustomResourceColumnDefinition]', + 'deprecated': 'bool', + 'deprecation_warning': 'str', + 'name': 'str', + 'schema': 'V1CustomResourceValidation', + 'selectable_fields': 'list[V1SelectableField]', + 'served': 'bool', + 'storage': 'bool', + 'subresources': 'V1CustomResourceSubresources' + } + + attribute_map = { + 'additional_printer_columns': 'additionalPrinterColumns', + 'deprecated': 'deprecated', + 'deprecation_warning': 'deprecationWarning', + 'name': 'name', + 'schema': 'schema', + 'selectable_fields': 'selectableFields', + 'served': 'served', + 'storage': 'storage', + 'subresources': 'subresources' + } + + def __init__(self, additional_printer_columns=None, deprecated=None, deprecation_warning=None, name=None, schema=None, selectable_fields=None, served=None, storage=None, subresources=None, local_vars_configuration=None): # noqa: E501 + """V1CustomResourceDefinitionVersion - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._additional_printer_columns = None + self._deprecated = None + self._deprecation_warning = None + self._name = None + self._schema = None + self._selectable_fields = None + self._served = None + self._storage = None + self._subresources = None + self.discriminator = None + + if additional_printer_columns is not None: + self.additional_printer_columns = additional_printer_columns + if deprecated is not None: + self.deprecated = deprecated + if deprecation_warning is not None: + self.deprecation_warning = deprecation_warning + self.name = name + if schema is not None: + self.schema = schema + if selectable_fields is not None: + self.selectable_fields = selectable_fields + self.served = served + self.storage = storage + if subresources is not None: + self.subresources = subresources + + @property + def additional_printer_columns(self): + """Gets the additional_printer_columns of this V1CustomResourceDefinitionVersion. # noqa: E501 + + additionalPrinterColumns specifies additional columns returned in Table output. See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. If no columns are specified, a single column displaying the age of the custom resource is used. # noqa: E501 + + :return: The additional_printer_columns of this V1CustomResourceDefinitionVersion. # noqa: E501 + :rtype: list[V1CustomResourceColumnDefinition] + """ + return self._additional_printer_columns + + @additional_printer_columns.setter + def additional_printer_columns(self, additional_printer_columns): + """Sets the additional_printer_columns of this V1CustomResourceDefinitionVersion. + + additionalPrinterColumns specifies additional columns returned in Table output. See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. If no columns are specified, a single column displaying the age of the custom resource is used. # noqa: E501 + + :param additional_printer_columns: The additional_printer_columns of this V1CustomResourceDefinitionVersion. # noqa: E501 + :type additional_printer_columns: list[V1CustomResourceColumnDefinition] + """ + + self._additional_printer_columns = additional_printer_columns + + @property + def deprecated(self): + """Gets the deprecated of this V1CustomResourceDefinitionVersion. # noqa: E501 + + deprecated indicates this version of the custom resource API is deprecated. When set to true, API requests to this version receive a warning header in the server response. Defaults to false. # noqa: E501 + + :return: The deprecated of this V1CustomResourceDefinitionVersion. # noqa: E501 + :rtype: bool + """ + return self._deprecated + + @deprecated.setter + def deprecated(self, deprecated): + """Sets the deprecated of this V1CustomResourceDefinitionVersion. + + deprecated indicates this version of the custom resource API is deprecated. When set to true, API requests to this version receive a warning header in the server response. Defaults to false. # noqa: E501 + + :param deprecated: The deprecated of this V1CustomResourceDefinitionVersion. # noqa: E501 + :type deprecated: bool + """ + + self._deprecated = deprecated + + @property + def deprecation_warning(self): + """Gets the deprecation_warning of this V1CustomResourceDefinitionVersion. # noqa: E501 + + deprecationWarning overrides the default warning returned to API clients. May only be set when `deprecated` is true. The default warning indicates this version is deprecated and recommends use of the newest served version of equal or greater stability, if one exists. # noqa: E501 + + :return: The deprecation_warning of this V1CustomResourceDefinitionVersion. # noqa: E501 + :rtype: str + """ + return self._deprecation_warning + + @deprecation_warning.setter + def deprecation_warning(self, deprecation_warning): + """Sets the deprecation_warning of this V1CustomResourceDefinitionVersion. + + deprecationWarning overrides the default warning returned to API clients. May only be set when `deprecated` is true. The default warning indicates this version is deprecated and recommends use of the newest served version of equal or greater stability, if one exists. # noqa: E501 + + :param deprecation_warning: The deprecation_warning of this V1CustomResourceDefinitionVersion. # noqa: E501 + :type deprecation_warning: str + """ + + self._deprecation_warning = deprecation_warning + + @property + def name(self): + """Gets the name of this V1CustomResourceDefinitionVersion. # noqa: E501 + + name is the version name, e.g. “v1”, “v2beta1”, etc. The custom resources are served under this version at `/apis///...` if `served` is true. # noqa: E501 + + :return: The name of this V1CustomResourceDefinitionVersion. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1CustomResourceDefinitionVersion. + + name is the version name, e.g. “v1”, “v2beta1”, etc. The custom resources are served under this version at `/apis///...` if `served` is true. # noqa: E501 + + :param name: The name of this V1CustomResourceDefinitionVersion. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def schema(self): + """Gets the schema of this V1CustomResourceDefinitionVersion. # noqa: E501 + + + :return: The schema of this V1CustomResourceDefinitionVersion. # noqa: E501 + :rtype: V1CustomResourceValidation + """ + return self._schema + + @schema.setter + def schema(self, schema): + """Sets the schema of this V1CustomResourceDefinitionVersion. + + + :param schema: The schema of this V1CustomResourceDefinitionVersion. # noqa: E501 + :type schema: V1CustomResourceValidation + """ + + self._schema = schema + + @property + def selectable_fields(self): + """Gets the selectable_fields of this V1CustomResourceDefinitionVersion. # noqa: E501 + + selectableFields specifies paths to fields that may be used as field selectors. A maximum of 8 selectable fields are allowed. See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors # noqa: E501 + + :return: The selectable_fields of this V1CustomResourceDefinitionVersion. # noqa: E501 + :rtype: list[V1SelectableField] + """ + return self._selectable_fields + + @selectable_fields.setter + def selectable_fields(self, selectable_fields): + """Sets the selectable_fields of this V1CustomResourceDefinitionVersion. + + selectableFields specifies paths to fields that may be used as field selectors. A maximum of 8 selectable fields are allowed. See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors # noqa: E501 + + :param selectable_fields: The selectable_fields of this V1CustomResourceDefinitionVersion. # noqa: E501 + :type selectable_fields: list[V1SelectableField] + """ + + self._selectable_fields = selectable_fields + + @property + def served(self): + """Gets the served of this V1CustomResourceDefinitionVersion. # noqa: E501 + + served is a flag enabling/disabling this version from being served via REST APIs # noqa: E501 + + :return: The served of this V1CustomResourceDefinitionVersion. # noqa: E501 + :rtype: bool + """ + return self._served + + @served.setter + def served(self, served): + """Sets the served of this V1CustomResourceDefinitionVersion. + + served is a flag enabling/disabling this version from being served via REST APIs # noqa: E501 + + :param served: The served of this V1CustomResourceDefinitionVersion. # noqa: E501 + :type served: bool + """ + if self.local_vars_configuration.client_side_validation and served is None: # noqa: E501 + raise ValueError("Invalid value for `served`, must not be `None`") # noqa: E501 + + self._served = served + + @property + def storage(self): + """Gets the storage of this V1CustomResourceDefinitionVersion. # noqa: E501 + + storage indicates this version should be used when persisting custom resources to storage. There must be exactly one version with storage=true. # noqa: E501 + + :return: The storage of this V1CustomResourceDefinitionVersion. # noqa: E501 + :rtype: bool + """ + return self._storage + + @storage.setter + def storage(self, storage): + """Sets the storage of this V1CustomResourceDefinitionVersion. + + storage indicates this version should be used when persisting custom resources to storage. There must be exactly one version with storage=true. # noqa: E501 + + :param storage: The storage of this V1CustomResourceDefinitionVersion. # noqa: E501 + :type storage: bool + """ + if self.local_vars_configuration.client_side_validation and storage is None: # noqa: E501 + raise ValueError("Invalid value for `storage`, must not be `None`") # noqa: E501 + + self._storage = storage + + @property + def subresources(self): + """Gets the subresources of this V1CustomResourceDefinitionVersion. # noqa: E501 + + + :return: The subresources of this V1CustomResourceDefinitionVersion. # noqa: E501 + :rtype: V1CustomResourceSubresources + """ + return self._subresources + + @subresources.setter + def subresources(self, subresources): + """Sets the subresources of this V1CustomResourceDefinitionVersion. + + + :param subresources: The subresources of this V1CustomResourceDefinitionVersion. # noqa: E501 + :type subresources: V1CustomResourceSubresources + """ + + self._subresources = subresources + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CustomResourceDefinitionVersion): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CustomResourceDefinitionVersion): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_custom_resource_subresource_scale.py b/kubernetes_asyncio/client/models/v1_custom_resource_subresource_scale.py new file mode 100644 index 0000000000..3861f6684c --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_custom_resource_subresource_scale.py @@ -0,0 +1,191 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CustomResourceSubresourceScale(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'label_selector_path': 'str', + 'spec_replicas_path': 'str', + 'status_replicas_path': 'str' + } + + attribute_map = { + 'label_selector_path': 'labelSelectorPath', + 'spec_replicas_path': 'specReplicasPath', + 'status_replicas_path': 'statusReplicasPath' + } + + def __init__(self, label_selector_path=None, spec_replicas_path=None, status_replicas_path=None, local_vars_configuration=None): # noqa: E501 + """V1CustomResourceSubresourceScale - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._label_selector_path = None + self._spec_replicas_path = None + self._status_replicas_path = None + self.discriminator = None + + if label_selector_path is not None: + self.label_selector_path = label_selector_path + self.spec_replicas_path = spec_replicas_path + self.status_replicas_path = status_replicas_path + + @property + def label_selector_path(self): + """Gets the label_selector_path of this V1CustomResourceSubresourceScale. # noqa: E501 + + labelSelectorPath defines the JSON path inside of a custom resource that corresponds to Scale `status.selector`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.status` or `.spec`. Must be set to work with HorizontalPodAutoscaler. The field pointed by this JSON path must be a string field (not a complex selector struct) which contains a serialized label selector in string form. More info: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions#scale-subresource If there is no value under the given path in the custom resource, the `status.selector` value in the `/scale` subresource will default to the empty string. # noqa: E501 + + :return: The label_selector_path of this V1CustomResourceSubresourceScale. # noqa: E501 + :rtype: str + """ + return self._label_selector_path + + @label_selector_path.setter + def label_selector_path(self, label_selector_path): + """Sets the label_selector_path of this V1CustomResourceSubresourceScale. + + labelSelectorPath defines the JSON path inside of a custom resource that corresponds to Scale `status.selector`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.status` or `.spec`. Must be set to work with HorizontalPodAutoscaler. The field pointed by this JSON path must be a string field (not a complex selector struct) which contains a serialized label selector in string form. More info: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions#scale-subresource If there is no value under the given path in the custom resource, the `status.selector` value in the `/scale` subresource will default to the empty string. # noqa: E501 + + :param label_selector_path: The label_selector_path of this V1CustomResourceSubresourceScale. # noqa: E501 + :type label_selector_path: str + """ + + self._label_selector_path = label_selector_path + + @property + def spec_replicas_path(self): + """Gets the spec_replicas_path of this V1CustomResourceSubresourceScale. # noqa: E501 + + specReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `spec.replicas`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.spec`. If there is no value under the given path in the custom resource, the `/scale` subresource will return an error on GET. # noqa: E501 + + :return: The spec_replicas_path of this V1CustomResourceSubresourceScale. # noqa: E501 + :rtype: str + """ + return self._spec_replicas_path + + @spec_replicas_path.setter + def spec_replicas_path(self, spec_replicas_path): + """Sets the spec_replicas_path of this V1CustomResourceSubresourceScale. + + specReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `spec.replicas`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.spec`. If there is no value under the given path in the custom resource, the `/scale` subresource will return an error on GET. # noqa: E501 + + :param spec_replicas_path: The spec_replicas_path of this V1CustomResourceSubresourceScale. # noqa: E501 + :type spec_replicas_path: str + """ + if self.local_vars_configuration.client_side_validation and spec_replicas_path is None: # noqa: E501 + raise ValueError("Invalid value for `spec_replicas_path`, must not be `None`") # noqa: E501 + + self._spec_replicas_path = spec_replicas_path + + @property + def status_replicas_path(self): + """Gets the status_replicas_path of this V1CustomResourceSubresourceScale. # noqa: E501 + + statusReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `status.replicas`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.status`. If there is no value under the given path in the custom resource, the `status.replicas` value in the `/scale` subresource will default to 0. # noqa: E501 + + :return: The status_replicas_path of this V1CustomResourceSubresourceScale. # noqa: E501 + :rtype: str + """ + return self._status_replicas_path + + @status_replicas_path.setter + def status_replicas_path(self, status_replicas_path): + """Sets the status_replicas_path of this V1CustomResourceSubresourceScale. + + statusReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `status.replicas`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.status`. If there is no value under the given path in the custom resource, the `status.replicas` value in the `/scale` subresource will default to 0. # noqa: E501 + + :param status_replicas_path: The status_replicas_path of this V1CustomResourceSubresourceScale. # noqa: E501 + :type status_replicas_path: str + """ + if self.local_vars_configuration.client_side_validation and status_replicas_path is None: # noqa: E501 + raise ValueError("Invalid value for `status_replicas_path`, must not be `None`") # noqa: E501 + + self._status_replicas_path = status_replicas_path + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CustomResourceSubresourceScale): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CustomResourceSubresourceScale): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_custom_resource_subresources.py b/kubernetes_asyncio/client/models/v1_custom_resource_subresources.py new file mode 100644 index 0000000000..c2b9e9fef5 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_custom_resource_subresources.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CustomResourceSubresources(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'scale': 'V1CustomResourceSubresourceScale', + 'status': 'object' + } + + attribute_map = { + 'scale': 'scale', + 'status': 'status' + } + + def __init__(self, scale=None, status=None, local_vars_configuration=None): # noqa: E501 + """V1CustomResourceSubresources - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._scale = None + self._status = None + self.discriminator = None + + if scale is not None: + self.scale = scale + if status is not None: + self.status = status + + @property + def scale(self): + """Gets the scale of this V1CustomResourceSubresources. # noqa: E501 + + + :return: The scale of this V1CustomResourceSubresources. # noqa: E501 + :rtype: V1CustomResourceSubresourceScale + """ + return self._scale + + @scale.setter + def scale(self, scale): + """Sets the scale of this V1CustomResourceSubresources. + + + :param scale: The scale of this V1CustomResourceSubresources. # noqa: E501 + :type scale: V1CustomResourceSubresourceScale + """ + + self._scale = scale + + @property + def status(self): + """Gets the status of this V1CustomResourceSubresources. # noqa: E501 + + status indicates the custom resource should serve a `/status` subresource. When enabled: 1. requests to the custom resource primary endpoint ignore changes to the `status` stanza of the object. 2. requests to the custom resource `/status` subresource ignore changes to anything other than the `status` stanza of the object. # noqa: E501 + + :return: The status of this V1CustomResourceSubresources. # noqa: E501 + :rtype: object + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1CustomResourceSubresources. + + status indicates the custom resource should serve a `/status` subresource. When enabled: 1. requests to the custom resource primary endpoint ignore changes to the `status` stanza of the object. 2. requests to the custom resource `/status` subresource ignore changes to anything other than the `status` stanza of the object. # noqa: E501 + + :param status: The status of this V1CustomResourceSubresources. # noqa: E501 + :type status: object + """ + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CustomResourceSubresources): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CustomResourceSubresources): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_custom_resource_validation.py b/kubernetes_asyncio/client/models/v1_custom_resource_validation.py new file mode 100644 index 0000000000..9b8a437d6b --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_custom_resource_validation.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1CustomResourceValidation(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'open_apiv3_schema': 'V1JSONSchemaProps' + } + + attribute_map = { + 'open_apiv3_schema': 'openAPIV3Schema' + } + + def __init__(self, open_apiv3_schema=None, local_vars_configuration=None): # noqa: E501 + """V1CustomResourceValidation - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._open_apiv3_schema = None + self.discriminator = None + + if open_apiv3_schema is not None: + self.open_apiv3_schema = open_apiv3_schema + + @property + def open_apiv3_schema(self): + """Gets the open_apiv3_schema of this V1CustomResourceValidation. # noqa: E501 + + + :return: The open_apiv3_schema of this V1CustomResourceValidation. # noqa: E501 + :rtype: V1JSONSchemaProps + """ + return self._open_apiv3_schema + + @open_apiv3_schema.setter + def open_apiv3_schema(self, open_apiv3_schema): + """Sets the open_apiv3_schema of this V1CustomResourceValidation. + + + :param open_apiv3_schema: The open_apiv3_schema of this V1CustomResourceValidation. # noqa: E501 + :type open_apiv3_schema: V1JSONSchemaProps + """ + + self._open_apiv3_schema = open_apiv3_schema + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1CustomResourceValidation): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1CustomResourceValidation): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_daemon_endpoint.py b/kubernetes_asyncio/client/models/v1_daemon_endpoint.py new file mode 100644 index 0000000000..2d5e72bab0 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_daemon_endpoint.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DaemonEndpoint(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'port': 'int' + } + + attribute_map = { + 'port': 'Port' + } + + def __init__(self, port=None, local_vars_configuration=None): # noqa: E501 + """V1DaemonEndpoint - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._port = None + self.discriminator = None + + self.port = port + + @property + def port(self): + """Gets the port of this V1DaemonEndpoint. # noqa: E501 + + Port number of the given endpoint. # noqa: E501 + + :return: The port of this V1DaemonEndpoint. # noqa: E501 + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """Sets the port of this V1DaemonEndpoint. + + Port number of the given endpoint. # noqa: E501 + + :param port: The port of this V1DaemonEndpoint. # noqa: E501 + :type port: int + """ + if self.local_vars_configuration.client_side_validation and port is None: # noqa: E501 + raise ValueError("Invalid value for `port`, must not be `None`") # noqa: E501 + + self._port = port + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DaemonEndpoint): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DaemonEndpoint): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_daemon_set.py b/kubernetes_asyncio/client/models/v1_daemon_set.py new file mode 100644 index 0000000000..41bd661593 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_daemon_set.py @@ -0,0 +1,239 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DaemonSet(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'spec': 'V1DaemonSetSpec', + 'status': 'V1DaemonSetStatus' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'spec': 'spec', + 'status': 'status' + } + + def __init__(self, api_version=None, kind=None, metadata=None, spec=None, status=None, local_vars_configuration=None): # noqa: E501 + """V1DaemonSet - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._metadata = None + self._spec = None + self._status = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + if spec is not None: + self.spec = spec + if status is not None: + self.status = status + + @property + def api_version(self): + """Gets the api_version of this V1DaemonSet. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1DaemonSet. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1DaemonSet. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1DaemonSet. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1DaemonSet. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1DaemonSet. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1DaemonSet. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1DaemonSet. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1DaemonSet. # noqa: E501 + + + :return: The metadata of this V1DaemonSet. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1DaemonSet. + + + :param metadata: The metadata of this V1DaemonSet. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def spec(self): + """Gets the spec of this V1DaemonSet. # noqa: E501 + + + :return: The spec of this V1DaemonSet. # noqa: E501 + :rtype: V1DaemonSetSpec + """ + return self._spec + + @spec.setter + def spec(self, spec): + """Sets the spec of this V1DaemonSet. + + + :param spec: The spec of this V1DaemonSet. # noqa: E501 + :type spec: V1DaemonSetSpec + """ + + self._spec = spec + + @property + def status(self): + """Gets the status of this V1DaemonSet. # noqa: E501 + + + :return: The status of this V1DaemonSet. # noqa: E501 + :rtype: V1DaemonSetStatus + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1DaemonSet. + + + :param status: The status of this V1DaemonSet. # noqa: E501 + :type status: V1DaemonSetStatus + """ + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DaemonSet): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DaemonSet): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_daemon_set_condition.py b/kubernetes_asyncio/client/models/v1_daemon_set_condition.py new file mode 100644 index 0000000000..6c8bee8143 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_daemon_set_condition.py @@ -0,0 +1,247 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DaemonSetCondition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'last_transition_time': 'datetime', + 'message': 'str', + 'reason': 'str', + 'status': 'str', + 'type': 'str' + } + + attribute_map = { + 'last_transition_time': 'lastTransitionTime', + 'message': 'message', + 'reason': 'reason', + 'status': 'status', + 'type': 'type' + } + + def __init__(self, last_transition_time=None, message=None, reason=None, status=None, type=None, local_vars_configuration=None): # noqa: E501 + """V1DaemonSetCondition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._last_transition_time = None + self._message = None + self._reason = None + self._status = None + self._type = None + self.discriminator = None + + if last_transition_time is not None: + self.last_transition_time = last_transition_time + if message is not None: + self.message = message + if reason is not None: + self.reason = reason + self.status = status + self.type = type + + @property + def last_transition_time(self): + """Gets the last_transition_time of this V1DaemonSetCondition. # noqa: E501 + + Last time the condition transitioned from one status to another. # noqa: E501 + + :return: The last_transition_time of this V1DaemonSetCondition. # noqa: E501 + :rtype: datetime + """ + return self._last_transition_time + + @last_transition_time.setter + def last_transition_time(self, last_transition_time): + """Sets the last_transition_time of this V1DaemonSetCondition. + + Last time the condition transitioned from one status to another. # noqa: E501 + + :param last_transition_time: The last_transition_time of this V1DaemonSetCondition. # noqa: E501 + :type last_transition_time: datetime + """ + + self._last_transition_time = last_transition_time + + @property + def message(self): + """Gets the message of this V1DaemonSetCondition. # noqa: E501 + + A human readable message indicating details about the transition. # noqa: E501 + + :return: The message of this V1DaemonSetCondition. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this V1DaemonSetCondition. + + A human readable message indicating details about the transition. # noqa: E501 + + :param message: The message of this V1DaemonSetCondition. # noqa: E501 + :type message: str + """ + + self._message = message + + @property + def reason(self): + """Gets the reason of this V1DaemonSetCondition. # noqa: E501 + + The reason for the condition's last transition. # noqa: E501 + + :return: The reason of this V1DaemonSetCondition. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this V1DaemonSetCondition. + + The reason for the condition's last transition. # noqa: E501 + + :param reason: The reason of this V1DaemonSetCondition. # noqa: E501 + :type reason: str + """ + + self._reason = reason + + @property + def status(self): + """Gets the status of this V1DaemonSetCondition. # noqa: E501 + + Status of the condition, one of True, False, Unknown. # noqa: E501 + + :return: The status of this V1DaemonSetCondition. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1DaemonSetCondition. + + Status of the condition, one of True, False, Unknown. # noqa: E501 + + :param status: The status of this V1DaemonSetCondition. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def type(self): + """Gets the type of this V1DaemonSetCondition. # noqa: E501 + + Type of DaemonSet condition. # noqa: E501 + + :return: The type of this V1DaemonSetCondition. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this V1DaemonSetCondition. + + Type of DaemonSet condition. # noqa: E501 + + :param type: The type of this V1DaemonSetCondition. # noqa: E501 + :type type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DaemonSetCondition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DaemonSetCondition): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_daemon_set_list.py b/kubernetes_asyncio/client/models/v1_daemon_set_list.py new file mode 100644 index 0000000000..8f8ecdf769 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_daemon_set_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DaemonSetList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1DaemonSet]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1DaemonSetList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1DaemonSetList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1DaemonSetList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1DaemonSetList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1DaemonSetList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1DaemonSetList. # noqa: E501 + + A list of daemon sets. # noqa: E501 + + :return: The items of this V1DaemonSetList. # noqa: E501 + :rtype: list[V1DaemonSet] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1DaemonSetList. + + A list of daemon sets. # noqa: E501 + + :param items: The items of this V1DaemonSetList. # noqa: E501 + :type items: list[V1DaemonSet] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1DaemonSetList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1DaemonSetList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1DaemonSetList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1DaemonSetList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1DaemonSetList. # noqa: E501 + + + :return: The metadata of this V1DaemonSetList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1DaemonSetList. + + + :param metadata: The metadata of this V1DaemonSetList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DaemonSetList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DaemonSetList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_daemon_set_spec.py b/kubernetes_asyncio/client/models/v1_daemon_set_spec.py new file mode 100644 index 0000000000..806d897c1a --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_daemon_set_spec.py @@ -0,0 +1,241 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DaemonSetSpec(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'min_ready_seconds': 'int', + 'revision_history_limit': 'int', + 'selector': 'V1LabelSelector', + 'template': 'V1PodTemplateSpec', + 'update_strategy': 'V1DaemonSetUpdateStrategy' + } + + attribute_map = { + 'min_ready_seconds': 'minReadySeconds', + 'revision_history_limit': 'revisionHistoryLimit', + 'selector': 'selector', + 'template': 'template', + 'update_strategy': 'updateStrategy' + } + + def __init__(self, min_ready_seconds=None, revision_history_limit=None, selector=None, template=None, update_strategy=None, local_vars_configuration=None): # noqa: E501 + """V1DaemonSetSpec - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._min_ready_seconds = None + self._revision_history_limit = None + self._selector = None + self._template = None + self._update_strategy = None + self.discriminator = None + + if min_ready_seconds is not None: + self.min_ready_seconds = min_ready_seconds + if revision_history_limit is not None: + self.revision_history_limit = revision_history_limit + self.selector = selector + self.template = template + if update_strategy is not None: + self.update_strategy = update_strategy + + @property + def min_ready_seconds(self): + """Gets the min_ready_seconds of this V1DaemonSetSpec. # noqa: E501 + + The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready). # noqa: E501 + + :return: The min_ready_seconds of this V1DaemonSetSpec. # noqa: E501 + :rtype: int + """ + return self._min_ready_seconds + + @min_ready_seconds.setter + def min_ready_seconds(self, min_ready_seconds): + """Sets the min_ready_seconds of this V1DaemonSetSpec. + + The minimum number of seconds for which a newly created DaemonSet pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready). # noqa: E501 + + :param min_ready_seconds: The min_ready_seconds of this V1DaemonSetSpec. # noqa: E501 + :type min_ready_seconds: int + """ + + self._min_ready_seconds = min_ready_seconds + + @property + def revision_history_limit(self): + """Gets the revision_history_limit of this V1DaemonSetSpec. # noqa: E501 + + The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. # noqa: E501 + + :return: The revision_history_limit of this V1DaemonSetSpec. # noqa: E501 + :rtype: int + """ + return self._revision_history_limit + + @revision_history_limit.setter + def revision_history_limit(self, revision_history_limit): + """Sets the revision_history_limit of this V1DaemonSetSpec. + + The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. # noqa: E501 + + :param revision_history_limit: The revision_history_limit of this V1DaemonSetSpec. # noqa: E501 + :type revision_history_limit: int + """ + + self._revision_history_limit = revision_history_limit + + @property + def selector(self): + """Gets the selector of this V1DaemonSetSpec. # noqa: E501 + + + :return: The selector of this V1DaemonSetSpec. # noqa: E501 + :rtype: V1LabelSelector + """ + return self._selector + + @selector.setter + def selector(self, selector): + """Sets the selector of this V1DaemonSetSpec. + + + :param selector: The selector of this V1DaemonSetSpec. # noqa: E501 + :type selector: V1LabelSelector + """ + if self.local_vars_configuration.client_side_validation and selector is None: # noqa: E501 + raise ValueError("Invalid value for `selector`, must not be `None`") # noqa: E501 + + self._selector = selector + + @property + def template(self): + """Gets the template of this V1DaemonSetSpec. # noqa: E501 + + + :return: The template of this V1DaemonSetSpec. # noqa: E501 + :rtype: V1PodTemplateSpec + """ + return self._template + + @template.setter + def template(self, template): + """Sets the template of this V1DaemonSetSpec. + + + :param template: The template of this V1DaemonSetSpec. # noqa: E501 + :type template: V1PodTemplateSpec + """ + if self.local_vars_configuration.client_side_validation and template is None: # noqa: E501 + raise ValueError("Invalid value for `template`, must not be `None`") # noqa: E501 + + self._template = template + + @property + def update_strategy(self): + """Gets the update_strategy of this V1DaemonSetSpec. # noqa: E501 + + + :return: The update_strategy of this V1DaemonSetSpec. # noqa: E501 + :rtype: V1DaemonSetUpdateStrategy + """ + return self._update_strategy + + @update_strategy.setter + def update_strategy(self, update_strategy): + """Sets the update_strategy of this V1DaemonSetSpec. + + + :param update_strategy: The update_strategy of this V1DaemonSetSpec. # noqa: E501 + :type update_strategy: V1DaemonSetUpdateStrategy + """ + + self._update_strategy = update_strategy + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DaemonSetSpec): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DaemonSetSpec): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_daemon_set_status.py b/kubernetes_asyncio/client/models/v1_daemon_set_status.py new file mode 100644 index 0000000000..1cc9337ddf --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_daemon_set_status.py @@ -0,0 +1,389 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DaemonSetStatus(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'collision_count': 'int', + 'conditions': 'list[V1DaemonSetCondition]', + 'current_number_scheduled': 'int', + 'desired_number_scheduled': 'int', + 'number_available': 'int', + 'number_misscheduled': 'int', + 'number_ready': 'int', + 'number_unavailable': 'int', + 'observed_generation': 'int', + 'updated_number_scheduled': 'int' + } + + attribute_map = { + 'collision_count': 'collisionCount', + 'conditions': 'conditions', + 'current_number_scheduled': 'currentNumberScheduled', + 'desired_number_scheduled': 'desiredNumberScheduled', + 'number_available': 'numberAvailable', + 'number_misscheduled': 'numberMisscheduled', + 'number_ready': 'numberReady', + 'number_unavailable': 'numberUnavailable', + 'observed_generation': 'observedGeneration', + 'updated_number_scheduled': 'updatedNumberScheduled' + } + + def __init__(self, collision_count=None, conditions=None, current_number_scheduled=None, desired_number_scheduled=None, number_available=None, number_misscheduled=None, number_ready=None, number_unavailable=None, observed_generation=None, updated_number_scheduled=None, local_vars_configuration=None): # noqa: E501 + """V1DaemonSetStatus - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._collision_count = None + self._conditions = None + self._current_number_scheduled = None + self._desired_number_scheduled = None + self._number_available = None + self._number_misscheduled = None + self._number_ready = None + self._number_unavailable = None + self._observed_generation = None + self._updated_number_scheduled = None + self.discriminator = None + + if collision_count is not None: + self.collision_count = collision_count + if conditions is not None: + self.conditions = conditions + self.current_number_scheduled = current_number_scheduled + self.desired_number_scheduled = desired_number_scheduled + if number_available is not None: + self.number_available = number_available + self.number_misscheduled = number_misscheduled + self.number_ready = number_ready + if number_unavailable is not None: + self.number_unavailable = number_unavailable + if observed_generation is not None: + self.observed_generation = observed_generation + if updated_number_scheduled is not None: + self.updated_number_scheduled = updated_number_scheduled + + @property + def collision_count(self): + """Gets the collision_count of this V1DaemonSetStatus. # noqa: E501 + + Count of hash collisions for the DaemonSet. The DaemonSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision. # noqa: E501 + + :return: The collision_count of this V1DaemonSetStatus. # noqa: E501 + :rtype: int + """ + return self._collision_count + + @collision_count.setter + def collision_count(self, collision_count): + """Sets the collision_count of this V1DaemonSetStatus. + + Count of hash collisions for the DaemonSet. The DaemonSet controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ControllerRevision. # noqa: E501 + + :param collision_count: The collision_count of this V1DaemonSetStatus. # noqa: E501 + :type collision_count: int + """ + + self._collision_count = collision_count + + @property + def conditions(self): + """Gets the conditions of this V1DaemonSetStatus. # noqa: E501 + + Represents the latest available observations of a DaemonSet's current state. # noqa: E501 + + :return: The conditions of this V1DaemonSetStatus. # noqa: E501 + :rtype: list[V1DaemonSetCondition] + """ + return self._conditions + + @conditions.setter + def conditions(self, conditions): + """Sets the conditions of this V1DaemonSetStatus. + + Represents the latest available observations of a DaemonSet's current state. # noqa: E501 + + :param conditions: The conditions of this V1DaemonSetStatus. # noqa: E501 + :type conditions: list[V1DaemonSetCondition] + """ + + self._conditions = conditions + + @property + def current_number_scheduled(self): + """Gets the current_number_scheduled of this V1DaemonSetStatus. # noqa: E501 + + The number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ # noqa: E501 + + :return: The current_number_scheduled of this V1DaemonSetStatus. # noqa: E501 + :rtype: int + """ + return self._current_number_scheduled + + @current_number_scheduled.setter + def current_number_scheduled(self, current_number_scheduled): + """Sets the current_number_scheduled of this V1DaemonSetStatus. + + The number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ # noqa: E501 + + :param current_number_scheduled: The current_number_scheduled of this V1DaemonSetStatus. # noqa: E501 + :type current_number_scheduled: int + """ + if self.local_vars_configuration.client_side_validation and current_number_scheduled is None: # noqa: E501 + raise ValueError("Invalid value for `current_number_scheduled`, must not be `None`") # noqa: E501 + + self._current_number_scheduled = current_number_scheduled + + @property + def desired_number_scheduled(self): + """Gets the desired_number_scheduled of this V1DaemonSetStatus. # noqa: E501 + + The total number of nodes that should be running the daemon pod (including nodes correctly running the daemon pod). More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ # noqa: E501 + + :return: The desired_number_scheduled of this V1DaemonSetStatus. # noqa: E501 + :rtype: int + """ + return self._desired_number_scheduled + + @desired_number_scheduled.setter + def desired_number_scheduled(self, desired_number_scheduled): + """Sets the desired_number_scheduled of this V1DaemonSetStatus. + + The total number of nodes that should be running the daemon pod (including nodes correctly running the daemon pod). More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ # noqa: E501 + + :param desired_number_scheduled: The desired_number_scheduled of this V1DaemonSetStatus. # noqa: E501 + :type desired_number_scheduled: int + """ + if self.local_vars_configuration.client_side_validation and desired_number_scheduled is None: # noqa: E501 + raise ValueError("Invalid value for `desired_number_scheduled`, must not be `None`") # noqa: E501 + + self._desired_number_scheduled = desired_number_scheduled + + @property + def number_available(self): + """Gets the number_available of this V1DaemonSetStatus. # noqa: E501 + + The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and available (ready for at least spec.minReadySeconds) # noqa: E501 + + :return: The number_available of this V1DaemonSetStatus. # noqa: E501 + :rtype: int + """ + return self._number_available + + @number_available.setter + def number_available(self, number_available): + """Sets the number_available of this V1DaemonSetStatus. + + The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and available (ready for at least spec.minReadySeconds) # noqa: E501 + + :param number_available: The number_available of this V1DaemonSetStatus. # noqa: E501 + :type number_available: int + """ + + self._number_available = number_available + + @property + def number_misscheduled(self): + """Gets the number_misscheduled of this V1DaemonSetStatus. # noqa: E501 + + The number of nodes that are running the daemon pod, but are not supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ # noqa: E501 + + :return: The number_misscheduled of this V1DaemonSetStatus. # noqa: E501 + :rtype: int + """ + return self._number_misscheduled + + @number_misscheduled.setter + def number_misscheduled(self, number_misscheduled): + """Sets the number_misscheduled of this V1DaemonSetStatus. + + The number of nodes that are running the daemon pod, but are not supposed to run the daemon pod. More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ # noqa: E501 + + :param number_misscheduled: The number_misscheduled of this V1DaemonSetStatus. # noqa: E501 + :type number_misscheduled: int + """ + if self.local_vars_configuration.client_side_validation and number_misscheduled is None: # noqa: E501 + raise ValueError("Invalid value for `number_misscheduled`, must not be `None`") # noqa: E501 + + self._number_misscheduled = number_misscheduled + + @property + def number_ready(self): + """Gets the number_ready of this V1DaemonSetStatus. # noqa: E501 + + numberReady is the number of nodes that should be running the daemon pod and have one or more of the daemon pod running with a Ready Condition. # noqa: E501 + + :return: The number_ready of this V1DaemonSetStatus. # noqa: E501 + :rtype: int + """ + return self._number_ready + + @number_ready.setter + def number_ready(self, number_ready): + """Sets the number_ready of this V1DaemonSetStatus. + + numberReady is the number of nodes that should be running the daemon pod and have one or more of the daemon pod running with a Ready Condition. # noqa: E501 + + :param number_ready: The number_ready of this V1DaemonSetStatus. # noqa: E501 + :type number_ready: int + """ + if self.local_vars_configuration.client_side_validation and number_ready is None: # noqa: E501 + raise ValueError("Invalid value for `number_ready`, must not be `None`") # noqa: E501 + + self._number_ready = number_ready + + @property + def number_unavailable(self): + """Gets the number_unavailable of this V1DaemonSetStatus. # noqa: E501 + + The number of nodes that should be running the daemon pod and have none of the daemon pod running and available (ready for at least spec.minReadySeconds) # noqa: E501 + + :return: The number_unavailable of this V1DaemonSetStatus. # noqa: E501 + :rtype: int + """ + return self._number_unavailable + + @number_unavailable.setter + def number_unavailable(self, number_unavailable): + """Sets the number_unavailable of this V1DaemonSetStatus. + + The number of nodes that should be running the daemon pod and have none of the daemon pod running and available (ready for at least spec.minReadySeconds) # noqa: E501 + + :param number_unavailable: The number_unavailable of this V1DaemonSetStatus. # noqa: E501 + :type number_unavailable: int + """ + + self._number_unavailable = number_unavailable + + @property + def observed_generation(self): + """Gets the observed_generation of this V1DaemonSetStatus. # noqa: E501 + + The most recent generation observed by the daemon set controller. # noqa: E501 + + :return: The observed_generation of this V1DaemonSetStatus. # noqa: E501 + :rtype: int + """ + return self._observed_generation + + @observed_generation.setter + def observed_generation(self, observed_generation): + """Sets the observed_generation of this V1DaemonSetStatus. + + The most recent generation observed by the daemon set controller. # noqa: E501 + + :param observed_generation: The observed_generation of this V1DaemonSetStatus. # noqa: E501 + :type observed_generation: int + """ + + self._observed_generation = observed_generation + + @property + def updated_number_scheduled(self): + """Gets the updated_number_scheduled of this V1DaemonSetStatus. # noqa: E501 + + The total number of nodes that are running updated daemon pod # noqa: E501 + + :return: The updated_number_scheduled of this V1DaemonSetStatus. # noqa: E501 + :rtype: int + """ + return self._updated_number_scheduled + + @updated_number_scheduled.setter + def updated_number_scheduled(self, updated_number_scheduled): + """Sets the updated_number_scheduled of this V1DaemonSetStatus. + + The total number of nodes that are running updated daemon pod # noqa: E501 + + :param updated_number_scheduled: The updated_number_scheduled of this V1DaemonSetStatus. # noqa: E501 + :type updated_number_scheduled: int + """ + + self._updated_number_scheduled = updated_number_scheduled + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DaemonSetStatus): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DaemonSetStatus): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_daemon_set_update_strategy.py b/kubernetes_asyncio/client/models/v1_daemon_set_update_strategy.py new file mode 100644 index 0000000000..d8d04e8a5d --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_daemon_set_update_strategy.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DaemonSetUpdateStrategy(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'rolling_update': 'V1RollingUpdateDaemonSet', + 'type': 'str' + } + + attribute_map = { + 'rolling_update': 'rollingUpdate', + 'type': 'type' + } + + def __init__(self, rolling_update=None, type=None, local_vars_configuration=None): # noqa: E501 + """V1DaemonSetUpdateStrategy - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._rolling_update = None + self._type = None + self.discriminator = None + + if rolling_update is not None: + self.rolling_update = rolling_update + if type is not None: + self.type = type + + @property + def rolling_update(self): + """Gets the rolling_update of this V1DaemonSetUpdateStrategy. # noqa: E501 + + + :return: The rolling_update of this V1DaemonSetUpdateStrategy. # noqa: E501 + :rtype: V1RollingUpdateDaemonSet + """ + return self._rolling_update + + @rolling_update.setter + def rolling_update(self, rolling_update): + """Sets the rolling_update of this V1DaemonSetUpdateStrategy. + + + :param rolling_update: The rolling_update of this V1DaemonSetUpdateStrategy. # noqa: E501 + :type rolling_update: V1RollingUpdateDaemonSet + """ + + self._rolling_update = rolling_update + + @property + def type(self): + """Gets the type of this V1DaemonSetUpdateStrategy. # noqa: E501 + + Type of daemon set update. Can be \"RollingUpdate\" or \"OnDelete\". Default is RollingUpdate. # noqa: E501 + + :return: The type of this V1DaemonSetUpdateStrategy. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this V1DaemonSetUpdateStrategy. + + Type of daemon set update. Can be \"RollingUpdate\" or \"OnDelete\". Default is RollingUpdate. # noqa: E501 + + :param type: The type of this V1DaemonSetUpdateStrategy. # noqa: E501 + :type type: str + """ + + self._type = type + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DaemonSetUpdateStrategy): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DaemonSetUpdateStrategy): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_delete_options.py b/kubernetes_asyncio/client/models/v1_delete_options.py new file mode 100644 index 0000000000..279512c085 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_delete_options.py @@ -0,0 +1,327 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeleteOptions(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'dry_run': 'list[str]', + 'grace_period_seconds': 'int', + 'ignore_store_read_error_with_cluster_breaking_potential': 'bool', + 'kind': 'str', + 'orphan_dependents': 'bool', + 'preconditions': 'V1Preconditions', + 'propagation_policy': 'str' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'dry_run': 'dryRun', + 'grace_period_seconds': 'gracePeriodSeconds', + 'ignore_store_read_error_with_cluster_breaking_potential': 'ignoreStoreReadErrorWithClusterBreakingPotential', + 'kind': 'kind', + 'orphan_dependents': 'orphanDependents', + 'preconditions': 'preconditions', + 'propagation_policy': 'propagationPolicy' + } + + def __init__(self, api_version=None, dry_run=None, grace_period_seconds=None, ignore_store_read_error_with_cluster_breaking_potential=None, kind=None, orphan_dependents=None, preconditions=None, propagation_policy=None, local_vars_configuration=None): # noqa: E501 + """V1DeleteOptions - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._dry_run = None + self._grace_period_seconds = None + self._ignore_store_read_error_with_cluster_breaking_potential = None + self._kind = None + self._orphan_dependents = None + self._preconditions = None + self._propagation_policy = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if dry_run is not None: + self.dry_run = dry_run + if grace_period_seconds is not None: + self.grace_period_seconds = grace_period_seconds + if ignore_store_read_error_with_cluster_breaking_potential is not None: + self.ignore_store_read_error_with_cluster_breaking_potential = ignore_store_read_error_with_cluster_breaking_potential + if kind is not None: + self.kind = kind + if orphan_dependents is not None: + self.orphan_dependents = orphan_dependents + if preconditions is not None: + self.preconditions = preconditions + if propagation_policy is not None: + self.propagation_policy = propagation_policy + + @property + def api_version(self): + """Gets the api_version of this V1DeleteOptions. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1DeleteOptions. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1DeleteOptions. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1DeleteOptions. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def dry_run(self): + """Gets the dry_run of this V1DeleteOptions. # noqa: E501 + + When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed # noqa: E501 + + :return: The dry_run of this V1DeleteOptions. # noqa: E501 + :rtype: list[str] + """ + return self._dry_run + + @dry_run.setter + def dry_run(self, dry_run): + """Sets the dry_run of this V1DeleteOptions. + + When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed # noqa: E501 + + :param dry_run: The dry_run of this V1DeleteOptions. # noqa: E501 + :type dry_run: list[str] + """ + + self._dry_run = dry_run + + @property + def grace_period_seconds(self): + """Gets the grace_period_seconds of this V1DeleteOptions. # noqa: E501 + + The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. # noqa: E501 + + :return: The grace_period_seconds of this V1DeleteOptions. # noqa: E501 + :rtype: int + """ + return self._grace_period_seconds + + @grace_period_seconds.setter + def grace_period_seconds(self, grace_period_seconds): + """Sets the grace_period_seconds of this V1DeleteOptions. + + The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. # noqa: E501 + + :param grace_period_seconds: The grace_period_seconds of this V1DeleteOptions. # noqa: E501 + :type grace_period_seconds: int + """ + + self._grace_period_seconds = grace_period_seconds + + @property + def ignore_store_read_error_with_cluster_breaking_potential(self): + """Gets the ignore_store_read_error_with_cluster_breaking_potential of this V1DeleteOptions. # noqa: E501 + + if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it # noqa: E501 + + :return: The ignore_store_read_error_with_cluster_breaking_potential of this V1DeleteOptions. # noqa: E501 + :rtype: bool + """ + return self._ignore_store_read_error_with_cluster_breaking_potential + + @ignore_store_read_error_with_cluster_breaking_potential.setter + def ignore_store_read_error_with_cluster_breaking_potential(self, ignore_store_read_error_with_cluster_breaking_potential): + """Sets the ignore_store_read_error_with_cluster_breaking_potential of this V1DeleteOptions. + + if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it # noqa: E501 + + :param ignore_store_read_error_with_cluster_breaking_potential: The ignore_store_read_error_with_cluster_breaking_potential of this V1DeleteOptions. # noqa: E501 + :type ignore_store_read_error_with_cluster_breaking_potential: bool + """ + + self._ignore_store_read_error_with_cluster_breaking_potential = ignore_store_read_error_with_cluster_breaking_potential + + @property + def kind(self): + """Gets the kind of this V1DeleteOptions. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1DeleteOptions. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1DeleteOptions. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1DeleteOptions. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def orphan_dependents(self): + """Gets the orphan_dependents of this V1DeleteOptions. # noqa: E501 + + Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. # noqa: E501 + + :return: The orphan_dependents of this V1DeleteOptions. # noqa: E501 + :rtype: bool + """ + return self._orphan_dependents + + @orphan_dependents.setter + def orphan_dependents(self, orphan_dependents): + """Sets the orphan_dependents of this V1DeleteOptions. + + Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. # noqa: E501 + + :param orphan_dependents: The orphan_dependents of this V1DeleteOptions. # noqa: E501 + :type orphan_dependents: bool + """ + + self._orphan_dependents = orphan_dependents + + @property + def preconditions(self): + """Gets the preconditions of this V1DeleteOptions. # noqa: E501 + + + :return: The preconditions of this V1DeleteOptions. # noqa: E501 + :rtype: V1Preconditions + """ + return self._preconditions + + @preconditions.setter + def preconditions(self, preconditions): + """Sets the preconditions of this V1DeleteOptions. + + + :param preconditions: The preconditions of this V1DeleteOptions. # noqa: E501 + :type preconditions: V1Preconditions + """ + + self._preconditions = preconditions + + @property + def propagation_policy(self): + """Gets the propagation_policy of this V1DeleteOptions. # noqa: E501 + + Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. # noqa: E501 + + :return: The propagation_policy of this V1DeleteOptions. # noqa: E501 + :rtype: str + """ + return self._propagation_policy + + @propagation_policy.setter + def propagation_policy(self, propagation_policy): + """Sets the propagation_policy of this V1DeleteOptions. + + Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. # noqa: E501 + + :param propagation_policy: The propagation_policy of this V1DeleteOptions. # noqa: E501 + :type propagation_policy: str + """ + + self._propagation_policy = propagation_policy + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeleteOptions): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeleteOptions): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_deployment.py b/kubernetes_asyncio/client/models/v1_deployment.py new file mode 100644 index 0000000000..03783f49da --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_deployment.py @@ -0,0 +1,239 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1Deployment(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'spec': 'V1DeploymentSpec', + 'status': 'V1DeploymentStatus' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'spec': 'spec', + 'status': 'status' + } + + def __init__(self, api_version=None, kind=None, metadata=None, spec=None, status=None, local_vars_configuration=None): # noqa: E501 + """V1Deployment - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._metadata = None + self._spec = None + self._status = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + if spec is not None: + self.spec = spec + if status is not None: + self.status = status + + @property + def api_version(self): + """Gets the api_version of this V1Deployment. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1Deployment. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1Deployment. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1Deployment. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1Deployment. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1Deployment. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1Deployment. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1Deployment. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1Deployment. # noqa: E501 + + + :return: The metadata of this V1Deployment. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1Deployment. + + + :param metadata: The metadata of this V1Deployment. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def spec(self): + """Gets the spec of this V1Deployment. # noqa: E501 + + + :return: The spec of this V1Deployment. # noqa: E501 + :rtype: V1DeploymentSpec + """ + return self._spec + + @spec.setter + def spec(self, spec): + """Sets the spec of this V1Deployment. + + + :param spec: The spec of this V1Deployment. # noqa: E501 + :type spec: V1DeploymentSpec + """ + + self._spec = spec + + @property + def status(self): + """Gets the status of this V1Deployment. # noqa: E501 + + + :return: The status of this V1Deployment. # noqa: E501 + :rtype: V1DeploymentStatus + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1Deployment. + + + :param status: The status of this V1Deployment. # noqa: E501 + :type status: V1DeploymentStatus + """ + + self._status = status + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1Deployment): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1Deployment): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_deployment_condition.py b/kubernetes_asyncio/client/models/v1_deployment_condition.py new file mode 100644 index 0000000000..339eeb0ecb --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_deployment_condition.py @@ -0,0 +1,275 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeploymentCondition(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'last_transition_time': 'datetime', + 'last_update_time': 'datetime', + 'message': 'str', + 'reason': 'str', + 'status': 'str', + 'type': 'str' + } + + attribute_map = { + 'last_transition_time': 'lastTransitionTime', + 'last_update_time': 'lastUpdateTime', + 'message': 'message', + 'reason': 'reason', + 'status': 'status', + 'type': 'type' + } + + def __init__(self, last_transition_time=None, last_update_time=None, message=None, reason=None, status=None, type=None, local_vars_configuration=None): # noqa: E501 + """V1DeploymentCondition - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._last_transition_time = None + self._last_update_time = None + self._message = None + self._reason = None + self._status = None + self._type = None + self.discriminator = None + + if last_transition_time is not None: + self.last_transition_time = last_transition_time + if last_update_time is not None: + self.last_update_time = last_update_time + if message is not None: + self.message = message + if reason is not None: + self.reason = reason + self.status = status + self.type = type + + @property + def last_transition_time(self): + """Gets the last_transition_time of this V1DeploymentCondition. # noqa: E501 + + Last time the condition transitioned from one status to another. # noqa: E501 + + :return: The last_transition_time of this V1DeploymentCondition. # noqa: E501 + :rtype: datetime + """ + return self._last_transition_time + + @last_transition_time.setter + def last_transition_time(self, last_transition_time): + """Sets the last_transition_time of this V1DeploymentCondition. + + Last time the condition transitioned from one status to another. # noqa: E501 + + :param last_transition_time: The last_transition_time of this V1DeploymentCondition. # noqa: E501 + :type last_transition_time: datetime + """ + + self._last_transition_time = last_transition_time + + @property + def last_update_time(self): + """Gets the last_update_time of this V1DeploymentCondition. # noqa: E501 + + The last time this condition was updated. # noqa: E501 + + :return: The last_update_time of this V1DeploymentCondition. # noqa: E501 + :rtype: datetime + """ + return self._last_update_time + + @last_update_time.setter + def last_update_time(self, last_update_time): + """Sets the last_update_time of this V1DeploymentCondition. + + The last time this condition was updated. # noqa: E501 + + :param last_update_time: The last_update_time of this V1DeploymentCondition. # noqa: E501 + :type last_update_time: datetime + """ + + self._last_update_time = last_update_time + + @property + def message(self): + """Gets the message of this V1DeploymentCondition. # noqa: E501 + + A human readable message indicating details about the transition. # noqa: E501 + + :return: The message of this V1DeploymentCondition. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this V1DeploymentCondition. + + A human readable message indicating details about the transition. # noqa: E501 + + :param message: The message of this V1DeploymentCondition. # noqa: E501 + :type message: str + """ + + self._message = message + + @property + def reason(self): + """Gets the reason of this V1DeploymentCondition. # noqa: E501 + + The reason for the condition's last transition. # noqa: E501 + + :return: The reason of this V1DeploymentCondition. # noqa: E501 + :rtype: str + """ + return self._reason + + @reason.setter + def reason(self, reason): + """Sets the reason of this V1DeploymentCondition. + + The reason for the condition's last transition. # noqa: E501 + + :param reason: The reason of this V1DeploymentCondition. # noqa: E501 + :type reason: str + """ + + self._reason = reason + + @property + def status(self): + """Gets the status of this V1DeploymentCondition. # noqa: E501 + + Status of the condition, one of True, False, Unknown. # noqa: E501 + + :return: The status of this V1DeploymentCondition. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this V1DeploymentCondition. + + Status of the condition, one of True, False, Unknown. # noqa: E501 + + :param status: The status of this V1DeploymentCondition. # noqa: E501 + :type status: str + """ + if self.local_vars_configuration.client_side_validation and status is None: # noqa: E501 + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def type(self): + """Gets the type of this V1DeploymentCondition. # noqa: E501 + + Type of deployment condition. # noqa: E501 + + :return: The type of this V1DeploymentCondition. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this V1DeploymentCondition. + + Type of deployment condition. # noqa: E501 + + :param type: The type of this V1DeploymentCondition. # noqa: E501 + :type type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeploymentCondition): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeploymentCondition): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_deployment_list.py b/kubernetes_asyncio/client/models/v1_deployment_list.py new file mode 100644 index 0000000000..e59a97c84e --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_deployment_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeploymentList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1Deployment]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1DeploymentList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1DeploymentList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1DeploymentList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1DeploymentList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1DeploymentList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1DeploymentList. # noqa: E501 + + Items is the list of Deployments. # noqa: E501 + + :return: The items of this V1DeploymentList. # noqa: E501 + :rtype: list[V1Deployment] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1DeploymentList. + + Items is the list of Deployments. # noqa: E501 + + :param items: The items of this V1DeploymentList. # noqa: E501 + :type items: list[V1Deployment] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1DeploymentList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1DeploymentList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1DeploymentList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1DeploymentList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1DeploymentList. # noqa: E501 + + + :return: The metadata of this V1DeploymentList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1DeploymentList. + + + :param metadata: The metadata of this V1DeploymentList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeploymentList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeploymentList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_deployment_spec.py b/kubernetes_asyncio/client/models/v1_deployment_spec.py new file mode 100644 index 0000000000..93440e5b7d --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_deployment_spec.py @@ -0,0 +1,325 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeploymentSpec(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'min_ready_seconds': 'int', + 'paused': 'bool', + 'progress_deadline_seconds': 'int', + 'replicas': 'int', + 'revision_history_limit': 'int', + 'selector': 'V1LabelSelector', + 'strategy': 'V1DeploymentStrategy', + 'template': 'V1PodTemplateSpec' + } + + attribute_map = { + 'min_ready_seconds': 'minReadySeconds', + 'paused': 'paused', + 'progress_deadline_seconds': 'progressDeadlineSeconds', + 'replicas': 'replicas', + 'revision_history_limit': 'revisionHistoryLimit', + 'selector': 'selector', + 'strategy': 'strategy', + 'template': 'template' + } + + def __init__(self, min_ready_seconds=None, paused=None, progress_deadline_seconds=None, replicas=None, revision_history_limit=None, selector=None, strategy=None, template=None, local_vars_configuration=None): # noqa: E501 + """V1DeploymentSpec - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._min_ready_seconds = None + self._paused = None + self._progress_deadline_seconds = None + self._replicas = None + self._revision_history_limit = None + self._selector = None + self._strategy = None + self._template = None + self.discriminator = None + + if min_ready_seconds is not None: + self.min_ready_seconds = min_ready_seconds + if paused is not None: + self.paused = paused + if progress_deadline_seconds is not None: + self.progress_deadline_seconds = progress_deadline_seconds + if replicas is not None: + self.replicas = replicas + if revision_history_limit is not None: + self.revision_history_limit = revision_history_limit + self.selector = selector + if strategy is not None: + self.strategy = strategy + self.template = template + + @property + def min_ready_seconds(self): + """Gets the min_ready_seconds of this V1DeploymentSpec. # noqa: E501 + + Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) # noqa: E501 + + :return: The min_ready_seconds of this V1DeploymentSpec. # noqa: E501 + :rtype: int + """ + return self._min_ready_seconds + + @min_ready_seconds.setter + def min_ready_seconds(self, min_ready_seconds): + """Sets the min_ready_seconds of this V1DeploymentSpec. + + Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) # noqa: E501 + + :param min_ready_seconds: The min_ready_seconds of this V1DeploymentSpec. # noqa: E501 + :type min_ready_seconds: int + """ + + self._min_ready_seconds = min_ready_seconds + + @property + def paused(self): + """Gets the paused of this V1DeploymentSpec. # noqa: E501 + + Indicates that the deployment is paused. # noqa: E501 + + :return: The paused of this V1DeploymentSpec. # noqa: E501 + :rtype: bool + """ + return self._paused + + @paused.setter + def paused(self, paused): + """Sets the paused of this V1DeploymentSpec. + + Indicates that the deployment is paused. # noqa: E501 + + :param paused: The paused of this V1DeploymentSpec. # noqa: E501 + :type paused: bool + """ + + self._paused = paused + + @property + def progress_deadline_seconds(self): + """Gets the progress_deadline_seconds of this V1DeploymentSpec. # noqa: E501 + + The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s. # noqa: E501 + + :return: The progress_deadline_seconds of this V1DeploymentSpec. # noqa: E501 + :rtype: int + """ + return self._progress_deadline_seconds + + @progress_deadline_seconds.setter + def progress_deadline_seconds(self, progress_deadline_seconds): + """Sets the progress_deadline_seconds of this V1DeploymentSpec. + + The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s. # noqa: E501 + + :param progress_deadline_seconds: The progress_deadline_seconds of this V1DeploymentSpec. # noqa: E501 + :type progress_deadline_seconds: int + """ + + self._progress_deadline_seconds = progress_deadline_seconds + + @property + def replicas(self): + """Gets the replicas of this V1DeploymentSpec. # noqa: E501 + + Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. # noqa: E501 + + :return: The replicas of this V1DeploymentSpec. # noqa: E501 + :rtype: int + """ + return self._replicas + + @replicas.setter + def replicas(self, replicas): + """Sets the replicas of this V1DeploymentSpec. + + Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. # noqa: E501 + + :param replicas: The replicas of this V1DeploymentSpec. # noqa: E501 + :type replicas: int + """ + + self._replicas = replicas + + @property + def revision_history_limit(self): + """Gets the revision_history_limit of this V1DeploymentSpec. # noqa: E501 + + The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. # noqa: E501 + + :return: The revision_history_limit of this V1DeploymentSpec. # noqa: E501 + :rtype: int + """ + return self._revision_history_limit + + @revision_history_limit.setter + def revision_history_limit(self, revision_history_limit): + """Sets the revision_history_limit of this V1DeploymentSpec. + + The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. # noqa: E501 + + :param revision_history_limit: The revision_history_limit of this V1DeploymentSpec. # noqa: E501 + :type revision_history_limit: int + """ + + self._revision_history_limit = revision_history_limit + + @property + def selector(self): + """Gets the selector of this V1DeploymentSpec. # noqa: E501 + + + :return: The selector of this V1DeploymentSpec. # noqa: E501 + :rtype: V1LabelSelector + """ + return self._selector + + @selector.setter + def selector(self, selector): + """Sets the selector of this V1DeploymentSpec. + + + :param selector: The selector of this V1DeploymentSpec. # noqa: E501 + :type selector: V1LabelSelector + """ + if self.local_vars_configuration.client_side_validation and selector is None: # noqa: E501 + raise ValueError("Invalid value for `selector`, must not be `None`") # noqa: E501 + + self._selector = selector + + @property + def strategy(self): + """Gets the strategy of this V1DeploymentSpec. # noqa: E501 + + + :return: The strategy of this V1DeploymentSpec. # noqa: E501 + :rtype: V1DeploymentStrategy + """ + return self._strategy + + @strategy.setter + def strategy(self, strategy): + """Sets the strategy of this V1DeploymentSpec. + + + :param strategy: The strategy of this V1DeploymentSpec. # noqa: E501 + :type strategy: V1DeploymentStrategy + """ + + self._strategy = strategy + + @property + def template(self): + """Gets the template of this V1DeploymentSpec. # noqa: E501 + + + :return: The template of this V1DeploymentSpec. # noqa: E501 + :rtype: V1PodTemplateSpec + """ + return self._template + + @template.setter + def template(self, template): + """Sets the template of this V1DeploymentSpec. + + + :param template: The template of this V1DeploymentSpec. # noqa: E501 + :type template: V1PodTemplateSpec + """ + if self.local_vars_configuration.client_side_validation and template is None: # noqa: E501 + raise ValueError("Invalid value for `template`, must not be `None`") # noqa: E501 + + self._template = template + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeploymentSpec): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeploymentSpec): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_deployment_status.py b/kubernetes_asyncio/client/models/v1_deployment_status.py new file mode 100644 index 0000000000..96856b506d --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_deployment_status.py @@ -0,0 +1,357 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeploymentStatus(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'available_replicas': 'int', + 'collision_count': 'int', + 'conditions': 'list[V1DeploymentCondition]', + 'observed_generation': 'int', + 'ready_replicas': 'int', + 'replicas': 'int', + 'terminating_replicas': 'int', + 'unavailable_replicas': 'int', + 'updated_replicas': 'int' + } + + attribute_map = { + 'available_replicas': 'availableReplicas', + 'collision_count': 'collisionCount', + 'conditions': 'conditions', + 'observed_generation': 'observedGeneration', + 'ready_replicas': 'readyReplicas', + 'replicas': 'replicas', + 'terminating_replicas': 'terminatingReplicas', + 'unavailable_replicas': 'unavailableReplicas', + 'updated_replicas': 'updatedReplicas' + } + + def __init__(self, available_replicas=None, collision_count=None, conditions=None, observed_generation=None, ready_replicas=None, replicas=None, terminating_replicas=None, unavailable_replicas=None, updated_replicas=None, local_vars_configuration=None): # noqa: E501 + """V1DeploymentStatus - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._available_replicas = None + self._collision_count = None + self._conditions = None + self._observed_generation = None + self._ready_replicas = None + self._replicas = None + self._terminating_replicas = None + self._unavailable_replicas = None + self._updated_replicas = None + self.discriminator = None + + if available_replicas is not None: + self.available_replicas = available_replicas + if collision_count is not None: + self.collision_count = collision_count + if conditions is not None: + self.conditions = conditions + if observed_generation is not None: + self.observed_generation = observed_generation + if ready_replicas is not None: + self.ready_replicas = ready_replicas + if replicas is not None: + self.replicas = replicas + if terminating_replicas is not None: + self.terminating_replicas = terminating_replicas + if unavailable_replicas is not None: + self.unavailable_replicas = unavailable_replicas + if updated_replicas is not None: + self.updated_replicas = updated_replicas + + @property + def available_replicas(self): + """Gets the available_replicas of this V1DeploymentStatus. # noqa: E501 + + Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment. # noqa: E501 + + :return: The available_replicas of this V1DeploymentStatus. # noqa: E501 + :rtype: int + """ + return self._available_replicas + + @available_replicas.setter + def available_replicas(self, available_replicas): + """Sets the available_replicas of this V1DeploymentStatus. + + Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment. # noqa: E501 + + :param available_replicas: The available_replicas of this V1DeploymentStatus. # noqa: E501 + :type available_replicas: int + """ + + self._available_replicas = available_replicas + + @property + def collision_count(self): + """Gets the collision_count of this V1DeploymentStatus. # noqa: E501 + + Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet. # noqa: E501 + + :return: The collision_count of this V1DeploymentStatus. # noqa: E501 + :rtype: int + """ + return self._collision_count + + @collision_count.setter + def collision_count(self, collision_count): + """Sets the collision_count of this V1DeploymentStatus. + + Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet. # noqa: E501 + + :param collision_count: The collision_count of this V1DeploymentStatus. # noqa: E501 + :type collision_count: int + """ + + self._collision_count = collision_count + + @property + def conditions(self): + """Gets the conditions of this V1DeploymentStatus. # noqa: E501 + + Represents the latest available observations of a deployment's current state. # noqa: E501 + + :return: The conditions of this V1DeploymentStatus. # noqa: E501 + :rtype: list[V1DeploymentCondition] + """ + return self._conditions + + @conditions.setter + def conditions(self, conditions): + """Sets the conditions of this V1DeploymentStatus. + + Represents the latest available observations of a deployment's current state. # noqa: E501 + + :param conditions: The conditions of this V1DeploymentStatus. # noqa: E501 + :type conditions: list[V1DeploymentCondition] + """ + + self._conditions = conditions + + @property + def observed_generation(self): + """Gets the observed_generation of this V1DeploymentStatus. # noqa: E501 + + The generation observed by the deployment controller. # noqa: E501 + + :return: The observed_generation of this V1DeploymentStatus. # noqa: E501 + :rtype: int + """ + return self._observed_generation + + @observed_generation.setter + def observed_generation(self, observed_generation): + """Sets the observed_generation of this V1DeploymentStatus. + + The generation observed by the deployment controller. # noqa: E501 + + :param observed_generation: The observed_generation of this V1DeploymentStatus. # noqa: E501 + :type observed_generation: int + """ + + self._observed_generation = observed_generation + + @property + def ready_replicas(self): + """Gets the ready_replicas of this V1DeploymentStatus. # noqa: E501 + + Total number of non-terminating pods targeted by this Deployment with a Ready Condition. # noqa: E501 + + :return: The ready_replicas of this V1DeploymentStatus. # noqa: E501 + :rtype: int + """ + return self._ready_replicas + + @ready_replicas.setter + def ready_replicas(self, ready_replicas): + """Sets the ready_replicas of this V1DeploymentStatus. + + Total number of non-terminating pods targeted by this Deployment with a Ready Condition. # noqa: E501 + + :param ready_replicas: The ready_replicas of this V1DeploymentStatus. # noqa: E501 + :type ready_replicas: int + """ + + self._ready_replicas = ready_replicas + + @property + def replicas(self): + """Gets the replicas of this V1DeploymentStatus. # noqa: E501 + + Total number of non-terminating pods targeted by this deployment (their labels match the selector). # noqa: E501 + + :return: The replicas of this V1DeploymentStatus. # noqa: E501 + :rtype: int + """ + return self._replicas + + @replicas.setter + def replicas(self, replicas): + """Sets the replicas of this V1DeploymentStatus. + + Total number of non-terminating pods targeted by this deployment (their labels match the selector). # noqa: E501 + + :param replicas: The replicas of this V1DeploymentStatus. # noqa: E501 + :type replicas: int + """ + + self._replicas = replicas + + @property + def terminating_replicas(self): + """Gets the terminating_replicas of this V1DeploymentStatus. # noqa: E501 + + Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. This is a beta field and requires enabling DeploymentReplicaSetTerminatingReplicas feature (enabled by default). # noqa: E501 + + :return: The terminating_replicas of this V1DeploymentStatus. # noqa: E501 + :rtype: int + """ + return self._terminating_replicas + + @terminating_replicas.setter + def terminating_replicas(self, terminating_replicas): + """Sets the terminating_replicas of this V1DeploymentStatus. + + Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. This is a beta field and requires enabling DeploymentReplicaSetTerminatingReplicas feature (enabled by default). # noqa: E501 + + :param terminating_replicas: The terminating_replicas of this V1DeploymentStatus. # noqa: E501 + :type terminating_replicas: int + """ + + self._terminating_replicas = terminating_replicas + + @property + def unavailable_replicas(self): + """Gets the unavailable_replicas of this V1DeploymentStatus. # noqa: E501 + + Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created. # noqa: E501 + + :return: The unavailable_replicas of this V1DeploymentStatus. # noqa: E501 + :rtype: int + """ + return self._unavailable_replicas + + @unavailable_replicas.setter + def unavailable_replicas(self, unavailable_replicas): + """Sets the unavailable_replicas of this V1DeploymentStatus. + + Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created. # noqa: E501 + + :param unavailable_replicas: The unavailable_replicas of this V1DeploymentStatus. # noqa: E501 + :type unavailable_replicas: int + """ + + self._unavailable_replicas = unavailable_replicas + + @property + def updated_replicas(self): + """Gets the updated_replicas of this V1DeploymentStatus. # noqa: E501 + + Total number of non-terminating pods targeted by this deployment that have the desired template spec. # noqa: E501 + + :return: The updated_replicas of this V1DeploymentStatus. # noqa: E501 + :rtype: int + """ + return self._updated_replicas + + @updated_replicas.setter + def updated_replicas(self, updated_replicas): + """Sets the updated_replicas of this V1DeploymentStatus. + + Total number of non-terminating pods targeted by this deployment that have the desired template spec. # noqa: E501 + + :param updated_replicas: The updated_replicas of this V1DeploymentStatus. # noqa: E501 + :type updated_replicas: int + """ + + self._updated_replicas = updated_replicas + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeploymentStatus): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeploymentStatus): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_deployment_strategy.py b/kubernetes_asyncio/client/models/v1_deployment_strategy.py new file mode 100644 index 0000000000..d8573ce023 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_deployment_strategy.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeploymentStrategy(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'rolling_update': 'V1RollingUpdateDeployment', + 'type': 'str' + } + + attribute_map = { + 'rolling_update': 'rollingUpdate', + 'type': 'type' + } + + def __init__(self, rolling_update=None, type=None, local_vars_configuration=None): # noqa: E501 + """V1DeploymentStrategy - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._rolling_update = None + self._type = None + self.discriminator = None + + if rolling_update is not None: + self.rolling_update = rolling_update + if type is not None: + self.type = type + + @property + def rolling_update(self): + """Gets the rolling_update of this V1DeploymentStrategy. # noqa: E501 + + + :return: The rolling_update of this V1DeploymentStrategy. # noqa: E501 + :rtype: V1RollingUpdateDeployment + """ + return self._rolling_update + + @rolling_update.setter + def rolling_update(self, rolling_update): + """Sets the rolling_update of this V1DeploymentStrategy. + + + :param rolling_update: The rolling_update of this V1DeploymentStrategy. # noqa: E501 + :type rolling_update: V1RollingUpdateDeployment + """ + + self._rolling_update = rolling_update + + @property + def type(self): + """Gets the type of this V1DeploymentStrategy. # noqa: E501 + + Type of deployment. Can be \"Recreate\" or \"RollingUpdate\". Default is RollingUpdate. # noqa: E501 + + :return: The type of this V1DeploymentStrategy. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this V1DeploymentStrategy. + + Type of deployment. Can be \"Recreate\" or \"RollingUpdate\". Default is RollingUpdate. # noqa: E501 + + :param type: The type of this V1DeploymentStrategy. # noqa: E501 + :type type: str + """ + + self._type = type + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeploymentStrategy): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeploymentStrategy): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device.py b/kubernetes_asyncio/client/models/v1_device.py new file mode 100644 index 0000000000..2855d6d8a4 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device.py @@ -0,0 +1,440 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1Device(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'all_nodes': 'bool', + 'allow_multiple_allocations': 'bool', + 'attributes': 'dict[str, V1DeviceAttribute]', + 'binding_conditions': 'list[str]', + 'binding_failure_conditions': 'list[str]', + 'binds_to_node': 'bool', + 'capacity': 'dict[str, V1DeviceCapacity]', + 'consumes_counters': 'list[V1DeviceCounterConsumption]', + 'name': 'str', + 'node_name': 'str', + 'node_selector': 'V1NodeSelector', + 'taints': 'list[V1DeviceTaint]' + } + + attribute_map = { + 'all_nodes': 'allNodes', + 'allow_multiple_allocations': 'allowMultipleAllocations', + 'attributes': 'attributes', + 'binding_conditions': 'bindingConditions', + 'binding_failure_conditions': 'bindingFailureConditions', + 'binds_to_node': 'bindsToNode', + 'capacity': 'capacity', + 'consumes_counters': 'consumesCounters', + 'name': 'name', + 'node_name': 'nodeName', + 'node_selector': 'nodeSelector', + 'taints': 'taints' + } + + def __init__(self, all_nodes=None, allow_multiple_allocations=None, attributes=None, binding_conditions=None, binding_failure_conditions=None, binds_to_node=None, capacity=None, consumes_counters=None, name=None, node_name=None, node_selector=None, taints=None, local_vars_configuration=None): # noqa: E501 + """V1Device - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._all_nodes = None + self._allow_multiple_allocations = None + self._attributes = None + self._binding_conditions = None + self._binding_failure_conditions = None + self._binds_to_node = None + self._capacity = None + self._consumes_counters = None + self._name = None + self._node_name = None + self._node_selector = None + self._taints = None + self.discriminator = None + + if all_nodes is not None: + self.all_nodes = all_nodes + if allow_multiple_allocations is not None: + self.allow_multiple_allocations = allow_multiple_allocations + if attributes is not None: + self.attributes = attributes + if binding_conditions is not None: + self.binding_conditions = binding_conditions + if binding_failure_conditions is not None: + self.binding_failure_conditions = binding_failure_conditions + if binds_to_node is not None: + self.binds_to_node = binds_to_node + if capacity is not None: + self.capacity = capacity + if consumes_counters is not None: + self.consumes_counters = consumes_counters + self.name = name + if node_name is not None: + self.node_name = node_name + if node_selector is not None: + self.node_selector = node_selector + if taints is not None: + self.taints = taints + + @property + def all_nodes(self): + """Gets the all_nodes of this V1Device. # noqa: E501 + + AllNodes indicates that all nodes have access to the device. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. # noqa: E501 + + :return: The all_nodes of this V1Device. # noqa: E501 + :rtype: bool + """ + return self._all_nodes + + @all_nodes.setter + def all_nodes(self, all_nodes): + """Sets the all_nodes of this V1Device. + + AllNodes indicates that all nodes have access to the device. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. # noqa: E501 + + :param all_nodes: The all_nodes of this V1Device. # noqa: E501 + :type all_nodes: bool + """ + + self._all_nodes = all_nodes + + @property + def allow_multiple_allocations(self): + """Gets the allow_multiple_allocations of this V1Device. # noqa: E501 + + AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests. If AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not. # noqa: E501 + + :return: The allow_multiple_allocations of this V1Device. # noqa: E501 + :rtype: bool + """ + return self._allow_multiple_allocations + + @allow_multiple_allocations.setter + def allow_multiple_allocations(self, allow_multiple_allocations): + """Sets the allow_multiple_allocations of this V1Device. + + AllowMultipleAllocations marks whether the device is allowed to be allocated to multiple DeviceRequests. If AllowMultipleAllocations is set to true, the device can be allocated more than once, and all of its capacity is consumable, regardless of whether the requestPolicy is defined or not. # noqa: E501 + + :param allow_multiple_allocations: The allow_multiple_allocations of this V1Device. # noqa: E501 + :type allow_multiple_allocations: bool + """ + + self._allow_multiple_allocations = allow_multiple_allocations + + @property + def attributes(self): + """Gets the attributes of this V1Device. # noqa: E501 + + Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set. The maximum number of attributes and capacities combined is 32. # noqa: E501 + + :return: The attributes of this V1Device. # noqa: E501 + :rtype: dict[str, V1DeviceAttribute] + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this V1Device. + + Attributes defines the set of attributes for this device. The name of each attribute must be unique in that set. The maximum number of attributes and capacities combined is 32. # noqa: E501 + + :param attributes: The attributes of this V1Device. # noqa: E501 + :type attributes: dict[str, V1DeviceAttribute] + """ + + self._attributes = attributes + + @property + def binding_conditions(self): + """Gets the binding_conditions of this V1Device. # noqa: E501 + + BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod. The maximum number of binding conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501 + + :return: The binding_conditions of this V1Device. # noqa: E501 + :rtype: list[str] + """ + return self._binding_conditions + + @binding_conditions.setter + def binding_conditions(self, binding_conditions): + """Sets the binding_conditions of this V1Device. + + BindingConditions defines the conditions for proceeding with binding. All of these conditions must be set in the per-device status conditions with a value of True to proceed with binding the pod to the node while scheduling the pod. The maximum number of binding conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501 + + :param binding_conditions: The binding_conditions of this V1Device. # noqa: E501 + :type binding_conditions: list[str] + """ + + self._binding_conditions = binding_conditions + + @property + def binding_failure_conditions(self): + """Gets the binding_failure_conditions of this V1Device. # noqa: E501 + + BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is set to \"True\", a binding failure occurred. The maximum number of binding failure conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501 + + :return: The binding_failure_conditions of this V1Device. # noqa: E501 + :rtype: list[str] + """ + return self._binding_failure_conditions + + @binding_failure_conditions.setter + def binding_failure_conditions(self, binding_failure_conditions): + """Sets the binding_failure_conditions of this V1Device. + + BindingFailureConditions defines the conditions for binding failure. They may be set in the per-device status conditions. If any is set to \"True\", a binding failure occurred. The maximum number of binding failure conditions is 4. The conditions must be a valid condition type string. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501 + + :param binding_failure_conditions: The binding_failure_conditions of this V1Device. # noqa: E501 + :type binding_failure_conditions: list[str] + """ + + self._binding_failure_conditions = binding_failure_conditions + + @property + def binds_to_node(self): + """Gets the binds_to_node of this V1Device. # noqa: E501 + + BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501 + + :return: The binds_to_node of this V1Device. # noqa: E501 + :rtype: bool + """ + return self._binds_to_node + + @binds_to_node.setter + def binds_to_node(self, binds_to_node): + """Sets the binds_to_node of this V1Device. + + BindsToNode indicates if the usage of an allocation involving this device has to be limited to exactly the node that was chosen when allocating the claim. If set to true, the scheduler will set the ResourceClaim.Status.Allocation.NodeSelector to match the node where the allocation was made. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501 + + :param binds_to_node: The binds_to_node of this V1Device. # noqa: E501 + :type binds_to_node: bool + """ + + self._binds_to_node = binds_to_node + + @property + def capacity(self): + """Gets the capacity of this V1Device. # noqa: E501 + + Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set. The maximum number of attributes and capacities combined is 32. # noqa: E501 + + :return: The capacity of this V1Device. # noqa: E501 + :rtype: dict[str, V1DeviceCapacity] + """ + return self._capacity + + @capacity.setter + def capacity(self, capacity): + """Sets the capacity of this V1Device. + + Capacity defines the set of capacities for this device. The name of each capacity must be unique in that set. The maximum number of attributes and capacities combined is 32. # noqa: E501 + + :param capacity: The capacity of this V1Device. # noqa: E501 + :type capacity: dict[str, V1DeviceCapacity] + """ + + self._capacity = capacity + + @property + def consumes_counters(self): + """Gets the consumes_counters of this V1Device. # noqa: E501 + + ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets. There can only be a single entry per counterSet. The maximum number of device counter consumptions per device is 2. # noqa: E501 + + :return: The consumes_counters of this V1Device. # noqa: E501 + :rtype: list[V1DeviceCounterConsumption] + """ + return self._consumes_counters + + @consumes_counters.setter + def consumes_counters(self, consumes_counters): + """Sets the consumes_counters of this V1Device. + + ConsumesCounters defines a list of references to sharedCounters and the set of counters that the device will consume from those counter sets. There can only be a single entry per counterSet. The maximum number of device counter consumptions per device is 2. # noqa: E501 + + :param consumes_counters: The consumes_counters of this V1Device. # noqa: E501 + :type consumes_counters: list[V1DeviceCounterConsumption] + """ + + self._consumes_counters = consumes_counters + + @property + def name(self): + """Gets the name of this V1Device. # noqa: E501 + + Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label. # noqa: E501 + + :return: The name of this V1Device. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1Device. + + Name is unique identifier among all devices managed by the driver in the pool. It must be a DNS label. # noqa: E501 + + :param name: The name of this V1Device. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def node_name(self): + """Gets the node_name of this V1Device. # noqa: E501 + + NodeName identifies the node where the device is available. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. # noqa: E501 + + :return: The node_name of this V1Device. # noqa: E501 + :rtype: str + """ + return self._node_name + + @node_name.setter + def node_name(self, node_name): + """Sets the node_name of this V1Device. + + NodeName identifies the node where the device is available. Must only be set if Spec.PerDeviceNodeSelection is set to true. At most one of NodeName, NodeSelector and AllNodes can be set. # noqa: E501 + + :param node_name: The node_name of this V1Device. # noqa: E501 + :type node_name: str + """ + + self._node_name = node_name + + @property + def node_selector(self): + """Gets the node_selector of this V1Device. # noqa: E501 + + + :return: The node_selector of this V1Device. # noqa: E501 + :rtype: V1NodeSelector + """ + return self._node_selector + + @node_selector.setter + def node_selector(self, node_selector): + """Sets the node_selector of this V1Device. + + + :param node_selector: The node_selector of this V1Device. # noqa: E501 + :type node_selector: V1NodeSelector + """ + + self._node_selector = node_selector + + @property + def taints(self): + """Gets the taints of this V1Device. # noqa: E501 + + If specified, these are the driver-defined taints. The maximum number of taints is 16. If taints are set for any device in a ResourceSlice, then the maximum number of allowed devices per ResourceSlice is 64 instead of 128. This is an alpha field and requires enabling the DRADeviceTaints feature gate. # noqa: E501 + + :return: The taints of this V1Device. # noqa: E501 + :rtype: list[V1DeviceTaint] + """ + return self._taints + + @taints.setter + def taints(self, taints): + """Sets the taints of this V1Device. + + If specified, these are the driver-defined taints. The maximum number of taints is 16. If taints are set for any device in a ResourceSlice, then the maximum number of allowed devices per ResourceSlice is 64 instead of 128. This is an alpha field and requires enabling the DRADeviceTaints feature gate. # noqa: E501 + + :param taints: The taints of this V1Device. # noqa: E501 + :type taints: list[V1DeviceTaint] + """ + + self._taints = taints + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1Device): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1Device): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_allocation_configuration.py b/kubernetes_asyncio/client/models/v1_device_allocation_configuration.py new file mode 100644 index 0000000000..1b06f16658 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_allocation_configuration.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceAllocationConfiguration(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'opaque': 'V1OpaqueDeviceConfiguration', + 'requests': 'list[str]', + 'source': 'str' + } + + attribute_map = { + 'opaque': 'opaque', + 'requests': 'requests', + 'source': 'source' + } + + def __init__(self, opaque=None, requests=None, source=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceAllocationConfiguration - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._opaque = None + self._requests = None + self._source = None + self.discriminator = None + + if opaque is not None: + self.opaque = opaque + if requests is not None: + self.requests = requests + self.source = source + + @property + def opaque(self): + """Gets the opaque of this V1DeviceAllocationConfiguration. # noqa: E501 + + + :return: The opaque of this V1DeviceAllocationConfiguration. # noqa: E501 + :rtype: V1OpaqueDeviceConfiguration + """ + return self._opaque + + @opaque.setter + def opaque(self, opaque): + """Sets the opaque of this V1DeviceAllocationConfiguration. + + + :param opaque: The opaque of this V1DeviceAllocationConfiguration. # noqa: E501 + :type opaque: V1OpaqueDeviceConfiguration + """ + + self._opaque = opaque + + @property + def requests(self): + """Gets the requests of this V1DeviceAllocationConfiguration. # noqa: E501 + + Requests lists the names of requests where the configuration applies. If empty, its applies to all requests. References to subrequests must include the name of the main request and may include the subrequest using the format
[/]. If just the main request is given, the configuration applies to all subrequests. # noqa: E501 + + :return: The requests of this V1DeviceAllocationConfiguration. # noqa: E501 + :rtype: list[str] + """ + return self._requests + + @requests.setter + def requests(self, requests): + """Sets the requests of this V1DeviceAllocationConfiguration. + + Requests lists the names of requests where the configuration applies. If empty, its applies to all requests. References to subrequests must include the name of the main request and may include the subrequest using the format
[/]. If just the main request is given, the configuration applies to all subrequests. # noqa: E501 + + :param requests: The requests of this V1DeviceAllocationConfiguration. # noqa: E501 + :type requests: list[str] + """ + + self._requests = requests + + @property + def source(self): + """Gets the source of this V1DeviceAllocationConfiguration. # noqa: E501 + + Source records whether the configuration comes from a class and thus is not something that a normal user would have been able to set or from a claim. # noqa: E501 + + :return: The source of this V1DeviceAllocationConfiguration. # noqa: E501 + :rtype: str + """ + return self._source + + @source.setter + def source(self, source): + """Sets the source of this V1DeviceAllocationConfiguration. + + Source records whether the configuration comes from a class and thus is not something that a normal user would have been able to set or from a claim. # noqa: E501 + + :param source: The source of this V1DeviceAllocationConfiguration. # noqa: E501 + :type source: str + """ + if self.local_vars_configuration.client_side_validation and source is None: # noqa: E501 + raise ValueError("Invalid value for `source`, must not be `None`") # noqa: E501 + + self._source = source + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceAllocationConfiguration): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceAllocationConfiguration): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_allocation_result.py b/kubernetes_asyncio/client/models/v1_device_allocation_result.py new file mode 100644 index 0000000000..1f98d1b9b8 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_allocation_result.py @@ -0,0 +1,161 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceAllocationResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'config': 'list[V1DeviceAllocationConfiguration]', + 'results': 'list[V1DeviceRequestAllocationResult]' + } + + attribute_map = { + 'config': 'config', + 'results': 'results' + } + + def __init__(self, config=None, results=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceAllocationResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._config = None + self._results = None + self.discriminator = None + + if config is not None: + self.config = config + if results is not None: + self.results = results + + @property + def config(self): + """Gets the config of this V1DeviceAllocationResult. # noqa: E501 + + This field is a combination of all the claim and class configuration parameters. Drivers can distinguish between those based on a flag. This includes configuration parameters for drivers which have no allocated devices in the result because it is up to the drivers which configuration parameters they support. They can silently ignore unknown configuration parameters. # noqa: E501 + + :return: The config of this V1DeviceAllocationResult. # noqa: E501 + :rtype: list[V1DeviceAllocationConfiguration] + """ + return self._config + + @config.setter + def config(self, config): + """Sets the config of this V1DeviceAllocationResult. + + This field is a combination of all the claim and class configuration parameters. Drivers can distinguish between those based on a flag. This includes configuration parameters for drivers which have no allocated devices in the result because it is up to the drivers which configuration parameters they support. They can silently ignore unknown configuration parameters. # noqa: E501 + + :param config: The config of this V1DeviceAllocationResult. # noqa: E501 + :type config: list[V1DeviceAllocationConfiguration] + """ + + self._config = config + + @property + def results(self): + """Gets the results of this V1DeviceAllocationResult. # noqa: E501 + + Results lists all allocated devices. # noqa: E501 + + :return: The results of this V1DeviceAllocationResult. # noqa: E501 + :rtype: list[V1DeviceRequestAllocationResult] + """ + return self._results + + @results.setter + def results(self, results): + """Sets the results of this V1DeviceAllocationResult. + + Results lists all allocated devices. # noqa: E501 + + :param results: The results of this V1DeviceAllocationResult. # noqa: E501 + :type results: list[V1DeviceRequestAllocationResult] + """ + + self._results = results + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceAllocationResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceAllocationResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_attribute.py b/kubernetes_asyncio/client/models/v1_device_attribute.py new file mode 100644 index 0000000000..6201a16abe --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_attribute.py @@ -0,0 +1,217 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceAttribute(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'bool': 'bool', + 'int': 'int', + 'string': 'str', + 'version': 'str' + } + + attribute_map = { + 'bool': 'bool', + 'int': 'int', + 'string': 'string', + 'version': 'version' + } + + def __init__(self, bool=None, int=None, string=None, version=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceAttribute - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._bool = None + self._int = None + self._string = None + self._version = None + self.discriminator = None + + if bool is not None: + self.bool = bool + if int is not None: + self.int = int + if string is not None: + self.string = string + if version is not None: + self.version = version + + @property + def bool(self): + """Gets the bool of this V1DeviceAttribute. # noqa: E501 + + BoolValue is a true/false value. # noqa: E501 + + :return: The bool of this V1DeviceAttribute. # noqa: E501 + :rtype: bool + """ + return self._bool + + @bool.setter + def bool(self, bool): + """Sets the bool of this V1DeviceAttribute. + + BoolValue is a true/false value. # noqa: E501 + + :param bool: The bool of this V1DeviceAttribute. # noqa: E501 + :type bool: bool + """ + + self._bool = bool + + @property + def int(self): + """Gets the int of this V1DeviceAttribute. # noqa: E501 + + IntValue is a number. # noqa: E501 + + :return: The int of this V1DeviceAttribute. # noqa: E501 + :rtype: int + """ + return self._int + + @int.setter + def int(self, int): + """Sets the int of this V1DeviceAttribute. + + IntValue is a number. # noqa: E501 + + :param int: The int of this V1DeviceAttribute. # noqa: E501 + :type int: int + """ + + self._int = int + + @property + def string(self): + """Gets the string of this V1DeviceAttribute. # noqa: E501 + + StringValue is a string. Must not be longer than 64 characters. # noqa: E501 + + :return: The string of this V1DeviceAttribute. # noqa: E501 + :rtype: str + """ + return self._string + + @string.setter + def string(self, string): + """Sets the string of this V1DeviceAttribute. + + StringValue is a string. Must not be longer than 64 characters. # noqa: E501 + + :param string: The string of this V1DeviceAttribute. # noqa: E501 + :type string: str + """ + + self._string = string + + @property + def version(self): + """Gets the version of this V1DeviceAttribute. # noqa: E501 + + VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters. # noqa: E501 + + :return: The version of this V1DeviceAttribute. # noqa: E501 + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this V1DeviceAttribute. + + VersionValue is a semantic version according to semver.org spec 2.0.0. Must not be longer than 64 characters. # noqa: E501 + + :param version: The version of this V1DeviceAttribute. # noqa: E501 + :type version: str + """ + + self._version = version + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceAttribute): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceAttribute): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_capacity.py b/kubernetes_asyncio/client/models/v1_device_capacity.py new file mode 100644 index 0000000000..4c19608c88 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_capacity.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceCapacity(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'request_policy': 'V1CapacityRequestPolicy', + 'value': 'str' + } + + attribute_map = { + 'request_policy': 'requestPolicy', + 'value': 'value' + } + + def __init__(self, request_policy=None, value=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceCapacity - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._request_policy = None + self._value = None + self.discriminator = None + + if request_policy is not None: + self.request_policy = request_policy + self.value = value + + @property + def request_policy(self): + """Gets the request_policy of this V1DeviceCapacity. # noqa: E501 + + + :return: The request_policy of this V1DeviceCapacity. # noqa: E501 + :rtype: V1CapacityRequestPolicy + """ + return self._request_policy + + @request_policy.setter + def request_policy(self, request_policy): + """Sets the request_policy of this V1DeviceCapacity. + + + :param request_policy: The request_policy of this V1DeviceCapacity. # noqa: E501 + :type request_policy: V1CapacityRequestPolicy + """ + + self._request_policy = request_policy + + @property + def value(self): + """Gets the value of this V1DeviceCapacity. # noqa: E501 + + Value defines how much of a certain capacity that device has. This field reflects the fixed total capacity and does not change. The consumed amount is tracked separately by scheduler and does not affect this value. # noqa: E501 + + :return: The value of this V1DeviceCapacity. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this V1DeviceCapacity. + + Value defines how much of a certain capacity that device has. This field reflects the fixed total capacity and does not change. The consumed amount is tracked separately by scheduler and does not affect this value. # noqa: E501 + + :param value: The value of this V1DeviceCapacity. # noqa: E501 + :type value: str + """ + if self.local_vars_configuration.client_side_validation and value is None: # noqa: E501 + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceCapacity): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceCapacity): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_claim.py b/kubernetes_asyncio/client/models/v1_device_claim.py new file mode 100644 index 0000000000..0f731dfd9a --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_claim.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceClaim(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'config': 'list[V1DeviceClaimConfiguration]', + 'constraints': 'list[V1DeviceConstraint]', + 'requests': 'list[V1DeviceRequest]' + } + + attribute_map = { + 'config': 'config', + 'constraints': 'constraints', + 'requests': 'requests' + } + + def __init__(self, config=None, constraints=None, requests=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceClaim - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._config = None + self._constraints = None + self._requests = None + self.discriminator = None + + if config is not None: + self.config = config + if constraints is not None: + self.constraints = constraints + if requests is not None: + self.requests = requests + + @property + def config(self): + """Gets the config of this V1DeviceClaim. # noqa: E501 + + This field holds configuration for multiple potential drivers which could satisfy requests in this claim. It is ignored while allocating the claim. # noqa: E501 + + :return: The config of this V1DeviceClaim. # noqa: E501 + :rtype: list[V1DeviceClaimConfiguration] + """ + return self._config + + @config.setter + def config(self, config): + """Sets the config of this V1DeviceClaim. + + This field holds configuration for multiple potential drivers which could satisfy requests in this claim. It is ignored while allocating the claim. # noqa: E501 + + :param config: The config of this V1DeviceClaim. # noqa: E501 + :type config: list[V1DeviceClaimConfiguration] + """ + + self._config = config + + @property + def constraints(self): + """Gets the constraints of this V1DeviceClaim. # noqa: E501 + + These constraints must be satisfied by the set of devices that get allocated for the claim. # noqa: E501 + + :return: The constraints of this V1DeviceClaim. # noqa: E501 + :rtype: list[V1DeviceConstraint] + """ + return self._constraints + + @constraints.setter + def constraints(self, constraints): + """Sets the constraints of this V1DeviceClaim. + + These constraints must be satisfied by the set of devices that get allocated for the claim. # noqa: E501 + + :param constraints: The constraints of this V1DeviceClaim. # noqa: E501 + :type constraints: list[V1DeviceConstraint] + """ + + self._constraints = constraints + + @property + def requests(self): + """Gets the requests of this V1DeviceClaim. # noqa: E501 + + Requests represent individual requests for distinct devices which must all be satisfied. If empty, nothing needs to be allocated. # noqa: E501 + + :return: The requests of this V1DeviceClaim. # noqa: E501 + :rtype: list[V1DeviceRequest] + """ + return self._requests + + @requests.setter + def requests(self, requests): + """Sets the requests of this V1DeviceClaim. + + Requests represent individual requests for distinct devices which must all be satisfied. If empty, nothing needs to be allocated. # noqa: E501 + + :param requests: The requests of this V1DeviceClaim. # noqa: E501 + :type requests: list[V1DeviceRequest] + """ + + self._requests = requests + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceClaim): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceClaim): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_claim_configuration.py b/kubernetes_asyncio/client/models/v1_device_claim_configuration.py new file mode 100644 index 0000000000..87ccfb70f8 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_claim_configuration.py @@ -0,0 +1,159 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceClaimConfiguration(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'opaque': 'V1OpaqueDeviceConfiguration', + 'requests': 'list[str]' + } + + attribute_map = { + 'opaque': 'opaque', + 'requests': 'requests' + } + + def __init__(self, opaque=None, requests=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceClaimConfiguration - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._opaque = None + self._requests = None + self.discriminator = None + + if opaque is not None: + self.opaque = opaque + if requests is not None: + self.requests = requests + + @property + def opaque(self): + """Gets the opaque of this V1DeviceClaimConfiguration. # noqa: E501 + + + :return: The opaque of this V1DeviceClaimConfiguration. # noqa: E501 + :rtype: V1OpaqueDeviceConfiguration + """ + return self._opaque + + @opaque.setter + def opaque(self, opaque): + """Sets the opaque of this V1DeviceClaimConfiguration. + + + :param opaque: The opaque of this V1DeviceClaimConfiguration. # noqa: E501 + :type opaque: V1OpaqueDeviceConfiguration + """ + + self._opaque = opaque + + @property + def requests(self): + """Gets the requests of this V1DeviceClaimConfiguration. # noqa: E501 + + Requests lists the names of requests where the configuration applies. If empty, it applies to all requests. References to subrequests must include the name of the main request and may include the subrequest using the format
[/]. If just the main request is given, the configuration applies to all subrequests. # noqa: E501 + + :return: The requests of this V1DeviceClaimConfiguration. # noqa: E501 + :rtype: list[str] + """ + return self._requests + + @requests.setter + def requests(self, requests): + """Sets the requests of this V1DeviceClaimConfiguration. + + Requests lists the names of requests where the configuration applies. If empty, it applies to all requests. References to subrequests must include the name of the main request and may include the subrequest using the format
[/]. If just the main request is given, the configuration applies to all subrequests. # noqa: E501 + + :param requests: The requests of this V1DeviceClaimConfiguration. # noqa: E501 + :type requests: list[str] + """ + + self._requests = requests + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceClaimConfiguration): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceClaimConfiguration): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_class.py b/kubernetes_asyncio/client/models/v1_device_class.py new file mode 100644 index 0000000000..15c0fc4d12 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_class.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceClass(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'kind': 'str', + 'metadata': 'V1ObjectMeta', + 'spec': 'V1DeviceClassSpec' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'kind': 'kind', + 'metadata': 'metadata', + 'spec': 'spec' + } + + def __init__(self, api_version=None, kind=None, metadata=None, spec=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceClass - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._kind = None + self._metadata = None + self._spec = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + self.spec = spec + + @property + def api_version(self): + """Gets the api_version of this V1DeviceClass. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1DeviceClass. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1DeviceClass. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1DeviceClass. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def kind(self): + """Gets the kind of this V1DeviceClass. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1DeviceClass. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1DeviceClass. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1DeviceClass. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1DeviceClass. # noqa: E501 + + + :return: The metadata of this V1DeviceClass. # noqa: E501 + :rtype: V1ObjectMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1DeviceClass. + + + :param metadata: The metadata of this V1DeviceClass. # noqa: E501 + :type metadata: V1ObjectMeta + """ + + self._metadata = metadata + + @property + def spec(self): + """Gets the spec of this V1DeviceClass. # noqa: E501 + + + :return: The spec of this V1DeviceClass. # noqa: E501 + :rtype: V1DeviceClassSpec + """ + return self._spec + + @spec.setter + def spec(self, spec): + """Sets the spec of this V1DeviceClass. + + + :param spec: The spec of this V1DeviceClass. # noqa: E501 + :type spec: V1DeviceClassSpec + """ + if self.local_vars_configuration.client_side_validation and spec is None: # noqa: E501 + raise ValueError("Invalid value for `spec`, must not be `None`") # noqa: E501 + + self._spec = spec + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceClass): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_class_configuration.py b/kubernetes_asyncio/client/models/v1_device_class_configuration.py new file mode 100644 index 0000000000..5fe41752d7 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_class_configuration.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceClassConfiguration(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'opaque': 'V1OpaqueDeviceConfiguration' + } + + attribute_map = { + 'opaque': 'opaque' + } + + def __init__(self, opaque=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceClassConfiguration - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._opaque = None + self.discriminator = None + + if opaque is not None: + self.opaque = opaque + + @property + def opaque(self): + """Gets the opaque of this V1DeviceClassConfiguration. # noqa: E501 + + + :return: The opaque of this V1DeviceClassConfiguration. # noqa: E501 + :rtype: V1OpaqueDeviceConfiguration + """ + return self._opaque + + @opaque.setter + def opaque(self, opaque): + """Sets the opaque of this V1DeviceClassConfiguration. + + + :param opaque: The opaque of this V1DeviceClassConfiguration. # noqa: E501 + :type opaque: V1OpaqueDeviceConfiguration + """ + + self._opaque = opaque + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceClassConfiguration): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceClassConfiguration): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_class_list.py b/kubernetes_asyncio/client/models/v1_device_class_list.py new file mode 100644 index 0000000000..340e9cc8d1 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_class_list.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceClassList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'api_version': 'str', + 'items': 'list[V1DeviceClass]', + 'kind': 'str', + 'metadata': 'V1ListMeta' + } + + attribute_map = { + 'api_version': 'apiVersion', + 'items': 'items', + 'kind': 'kind', + 'metadata': 'metadata' + } + + def __init__(self, api_version=None, items=None, kind=None, metadata=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceClassList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._api_version = None + self._items = None + self._kind = None + self._metadata = None + self.discriminator = None + + if api_version is not None: + self.api_version = api_version + self.items = items + if kind is not None: + self.kind = kind + if metadata is not None: + self.metadata = metadata + + @property + def api_version(self): + """Gets the api_version of this V1DeviceClassList. # noqa: E501 + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :return: The api_version of this V1DeviceClassList. # noqa: E501 + :rtype: str + """ + return self._api_version + + @api_version.setter + def api_version(self, api_version): + """Sets the api_version of this V1DeviceClassList. + + APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa: E501 + + :param api_version: The api_version of this V1DeviceClassList. # noqa: E501 + :type api_version: str + """ + + self._api_version = api_version + + @property + def items(self): + """Gets the items of this V1DeviceClassList. # noqa: E501 + + Items is the list of resource classes. # noqa: E501 + + :return: The items of this V1DeviceClassList. # noqa: E501 + :rtype: list[V1DeviceClass] + """ + return self._items + + @items.setter + def items(self, items): + """Sets the items of this V1DeviceClassList. + + Items is the list of resource classes. # noqa: E501 + + :param items: The items of this V1DeviceClassList. # noqa: E501 + :type items: list[V1DeviceClass] + """ + if self.local_vars_configuration.client_side_validation and items is None: # noqa: E501 + raise ValueError("Invalid value for `items`, must not be `None`") # noqa: E501 + + self._items = items + + @property + def kind(self): + """Gets the kind of this V1DeviceClassList. # noqa: E501 + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :return: The kind of this V1DeviceClassList. # noqa: E501 + :rtype: str + """ + return self._kind + + @kind.setter + def kind(self, kind): + """Sets the kind of this V1DeviceClassList. + + Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 + + :param kind: The kind of this V1DeviceClassList. # noqa: E501 + :type kind: str + """ + + self._kind = kind + + @property + def metadata(self): + """Gets the metadata of this V1DeviceClassList. # noqa: E501 + + + :return: The metadata of this V1DeviceClassList. # noqa: E501 + :rtype: V1ListMeta + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this V1DeviceClassList. + + + :param metadata: The metadata of this V1DeviceClassList. # noqa: E501 + :type metadata: V1ListMeta + """ + + self._metadata = metadata + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceClassList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceClassList): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_class_spec.py b/kubernetes_asyncio/client/models/v1_device_class_spec.py new file mode 100644 index 0000000000..0eda5ffaeb --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_class_spec.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceClassSpec(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'config': 'list[V1DeviceClassConfiguration]', + 'extended_resource_name': 'str', + 'selectors': 'list[V1DeviceSelector]' + } + + attribute_map = { + 'config': 'config', + 'extended_resource_name': 'extendedResourceName', + 'selectors': 'selectors' + } + + def __init__(self, config=None, extended_resource_name=None, selectors=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceClassSpec - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._config = None + self._extended_resource_name = None + self._selectors = None + self.discriminator = None + + if config is not None: + self.config = config + if extended_resource_name is not None: + self.extended_resource_name = extended_resource_name + if selectors is not None: + self.selectors = selectors + + @property + def config(self): + """Gets the config of this V1DeviceClassSpec. # noqa: E501 + + Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver. They are passed to the driver, but are not considered while allocating the claim. # noqa: E501 + + :return: The config of this V1DeviceClassSpec. # noqa: E501 + :rtype: list[V1DeviceClassConfiguration] + """ + return self._config + + @config.setter + def config(self, config): + """Sets the config of this V1DeviceClassSpec. + + Config defines configuration parameters that apply to each device that is claimed via this class. Some classses may potentially be satisfied by multiple drivers, so each instance of a vendor configuration applies to exactly one driver. They are passed to the driver, but are not considered while allocating the claim. # noqa: E501 + + :param config: The config of this V1DeviceClassSpec. # noqa: E501 + :type config: list[V1DeviceClassConfiguration] + """ + + self._config = config + + @property + def extended_resource_name(self): + """Gets the extended_resource_name of this V1DeviceClassSpec. # noqa: E501 + + ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked. This is an alpha field. # noqa: E501 + + :return: The extended_resource_name of this V1DeviceClassSpec. # noqa: E501 + :rtype: str + """ + return self._extended_resource_name + + @extended_resource_name.setter + def extended_resource_name(self, extended_resource_name): + """Sets the extended_resource_name of this V1DeviceClassSpec. + + ExtendedResourceName is the extended resource name for the devices of this class. The devices of this class can be used to satisfy a pod's extended resource requests. It has the same format as the name of a pod's extended resource. It should be unique among all the device classes in a cluster. If two device classes have the same name, then the class created later is picked to satisfy a pod's extended resource requests. If two classes are created at the same time, then the name of the class lexicographically sorted first is picked. This is an alpha field. # noqa: E501 + + :param extended_resource_name: The extended_resource_name of this V1DeviceClassSpec. # noqa: E501 + :type extended_resource_name: str + """ + + self._extended_resource_name = extended_resource_name + + @property + def selectors(self): + """Gets the selectors of this V1DeviceClassSpec. # noqa: E501 + + Each selector must be satisfied by a device which is claimed via this class. # noqa: E501 + + :return: The selectors of this V1DeviceClassSpec. # noqa: E501 + :rtype: list[V1DeviceSelector] + """ + return self._selectors + + @selectors.setter + def selectors(self, selectors): + """Sets the selectors of this V1DeviceClassSpec. + + Each selector must be satisfied by a device which is claimed via this class. # noqa: E501 + + :param selectors: The selectors of this V1DeviceClassSpec. # noqa: E501 + :type selectors: list[V1DeviceSelector] + """ + + self._selectors = selectors + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceClassSpec): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceClassSpec): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_constraint.py b/kubernetes_asyncio/client/models/v1_device_constraint.py new file mode 100644 index 0000000000..c3f9e91919 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_constraint.py @@ -0,0 +1,189 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceConstraint(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'distinct_attribute': 'str', + 'match_attribute': 'str', + 'requests': 'list[str]' + } + + attribute_map = { + 'distinct_attribute': 'distinctAttribute', + 'match_attribute': 'matchAttribute', + 'requests': 'requests' + } + + def __init__(self, distinct_attribute=None, match_attribute=None, requests=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceConstraint - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._distinct_attribute = None + self._match_attribute = None + self._requests = None + self.discriminator = None + + if distinct_attribute is not None: + self.distinct_attribute = distinct_attribute + if match_attribute is not None: + self.match_attribute = match_attribute + if requests is not None: + self.requests = requests + + @property + def distinct_attribute(self): + """Gets the distinct_attribute of this V1DeviceConstraint. # noqa: E501 + + DistinctAttribute requires that all devices in question have this attribute and that its type and value are unique across those devices. This acts as the inverse of MatchAttribute. This constraint is used to avoid allocating multiple requests to the same device by ensuring attribute-level differentiation. This is useful for scenarios where resource requests must be fulfilled by separate physical devices. For example, a container requests two network interfaces that must be allocated from two different physical NICs. # noqa: E501 + + :return: The distinct_attribute of this V1DeviceConstraint. # noqa: E501 + :rtype: str + """ + return self._distinct_attribute + + @distinct_attribute.setter + def distinct_attribute(self, distinct_attribute): + """Sets the distinct_attribute of this V1DeviceConstraint. + + DistinctAttribute requires that all devices in question have this attribute and that its type and value are unique across those devices. This acts as the inverse of MatchAttribute. This constraint is used to avoid allocating multiple requests to the same device by ensuring attribute-level differentiation. This is useful for scenarios where resource requests must be fulfilled by separate physical devices. For example, a container requests two network interfaces that must be allocated from two different physical NICs. # noqa: E501 + + :param distinct_attribute: The distinct_attribute of this V1DeviceConstraint. # noqa: E501 + :type distinct_attribute: str + """ + + self._distinct_attribute = distinct_attribute + + @property + def match_attribute(self): + """Gets the match_attribute of this V1DeviceConstraint. # noqa: E501 + + MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices. For example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen. Must include the domain qualifier. # noqa: E501 + + :return: The match_attribute of this V1DeviceConstraint. # noqa: E501 + :rtype: str + """ + return self._match_attribute + + @match_attribute.setter + def match_attribute(self, match_attribute): + """Sets the match_attribute of this V1DeviceConstraint. + + MatchAttribute requires that all devices in question have this attribute and that its type and value are the same across those devices. For example, if you specified \"dra.example.com/numa\" (a hypothetical example!), then only devices in the same NUMA node will be chosen. A device which does not have that attribute will not be chosen. All devices should use a value of the same type for this attribute because that is part of its specification, but if one device doesn't, then it also will not be chosen. Must include the domain qualifier. # noqa: E501 + + :param match_attribute: The match_attribute of this V1DeviceConstraint. # noqa: E501 + :type match_attribute: str + """ + + self._match_attribute = match_attribute + + @property + def requests(self): + """Gets the requests of this V1DeviceConstraint. # noqa: E501 + + Requests is a list of the one or more requests in this claim which must co-satisfy this constraint. If a request is fulfilled by multiple devices, then all of the devices must satisfy the constraint. If this is not specified, this constraint applies to all requests in this claim. References to subrequests must include the name of the main request and may include the subrequest using the format
[/]. If just the main request is given, the constraint applies to all subrequests. # noqa: E501 + + :return: The requests of this V1DeviceConstraint. # noqa: E501 + :rtype: list[str] + """ + return self._requests + + @requests.setter + def requests(self, requests): + """Sets the requests of this V1DeviceConstraint. + + Requests is a list of the one or more requests in this claim which must co-satisfy this constraint. If a request is fulfilled by multiple devices, then all of the devices must satisfy the constraint. If this is not specified, this constraint applies to all requests in this claim. References to subrequests must include the name of the main request and may include the subrequest using the format
[/]. If just the main request is given, the constraint applies to all subrequests. # noqa: E501 + + :param requests: The requests of this V1DeviceConstraint. # noqa: E501 + :type requests: list[str] + """ + + self._requests = requests + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceConstraint): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceConstraint): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_counter_consumption.py b/kubernetes_asyncio/client/models/v1_device_counter_consumption.py new file mode 100644 index 0000000000..a35c4186d6 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_counter_consumption.py @@ -0,0 +1,163 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceCounterConsumption(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'counter_set': 'str', + 'counters': 'dict[str, V1Counter]' + } + + attribute_map = { + 'counter_set': 'counterSet', + 'counters': 'counters' + } + + def __init__(self, counter_set=None, counters=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceCounterConsumption - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._counter_set = None + self._counters = None + self.discriminator = None + + self.counter_set = counter_set + self.counters = counters + + @property + def counter_set(self): + """Gets the counter_set of this V1DeviceCounterConsumption. # noqa: E501 + + CounterSet is the name of the set from which the counters defined will be consumed. # noqa: E501 + + :return: The counter_set of this V1DeviceCounterConsumption. # noqa: E501 + :rtype: str + """ + return self._counter_set + + @counter_set.setter + def counter_set(self, counter_set): + """Sets the counter_set of this V1DeviceCounterConsumption. + + CounterSet is the name of the set from which the counters defined will be consumed. # noqa: E501 + + :param counter_set: The counter_set of this V1DeviceCounterConsumption. # noqa: E501 + :type counter_set: str + """ + if self.local_vars_configuration.client_side_validation and counter_set is None: # noqa: E501 + raise ValueError("Invalid value for `counter_set`, must not be `None`") # noqa: E501 + + self._counter_set = counter_set + + @property + def counters(self): + """Gets the counters of this V1DeviceCounterConsumption. # noqa: E501 + + Counters defines the counters that will be consumed by the device. The maximum number of counters is 32. # noqa: E501 + + :return: The counters of this V1DeviceCounterConsumption. # noqa: E501 + :rtype: dict[str, V1Counter] + """ + return self._counters + + @counters.setter + def counters(self, counters): + """Sets the counters of this V1DeviceCounterConsumption. + + Counters defines the counters that will be consumed by the device. The maximum number of counters is 32. # noqa: E501 + + :param counters: The counters of this V1DeviceCounterConsumption. # noqa: E501 + :type counters: dict[str, V1Counter] + """ + if self.local_vars_configuration.client_side_validation and counters is None: # noqa: E501 + raise ValueError("Invalid value for `counters`, must not be `None`") # noqa: E501 + + self._counters = counters + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceCounterConsumption): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceCounterConsumption): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_request.py b/kubernetes_asyncio/client/models/v1_device_request.py new file mode 100644 index 0000000000..81b00a24a2 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_request.py @@ -0,0 +1,188 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'exactly': 'V1ExactDeviceRequest', + 'first_available': 'list[V1DeviceSubRequest]', + 'name': 'str' + } + + attribute_map = { + 'exactly': 'exactly', + 'first_available': 'firstAvailable', + 'name': 'name' + } + + def __init__(self, exactly=None, first_available=None, name=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._exactly = None + self._first_available = None + self._name = None + self.discriminator = None + + if exactly is not None: + self.exactly = exactly + if first_available is not None: + self.first_available = first_available + self.name = name + + @property + def exactly(self): + """Gets the exactly of this V1DeviceRequest. # noqa: E501 + + + :return: The exactly of this V1DeviceRequest. # noqa: E501 + :rtype: V1ExactDeviceRequest + """ + return self._exactly + + @exactly.setter + def exactly(self, exactly): + """Sets the exactly of this V1DeviceRequest. + + + :param exactly: The exactly of this V1DeviceRequest. # noqa: E501 + :type exactly: V1ExactDeviceRequest + """ + + self._exactly = exactly + + @property + def first_available(self): + """Gets the first_available of this V1DeviceRequest. # noqa: E501 + + FirstAvailable contains subrequests, of which exactly one will be selected by the scheduler. It tries to satisfy them in the order in which they are listed here. So if there are two entries in the list, the scheduler will only check the second one if it determines that the first one can not be used. DRA does not yet implement scoring, so the scheduler will select the first set of devices that satisfies all the requests in the claim. And if the requirements can be satisfied on more than one node, other scheduling features will determine which node is chosen. This means that the set of devices allocated to a claim might not be the optimal set available to the cluster. Scoring will be implemented later. # noqa: E501 + + :return: The first_available of this V1DeviceRequest. # noqa: E501 + :rtype: list[V1DeviceSubRequest] + """ + return self._first_available + + @first_available.setter + def first_available(self, first_available): + """Sets the first_available of this V1DeviceRequest. + + FirstAvailable contains subrequests, of which exactly one will be selected by the scheduler. It tries to satisfy them in the order in which they are listed here. So if there are two entries in the list, the scheduler will only check the second one if it determines that the first one can not be used. DRA does not yet implement scoring, so the scheduler will select the first set of devices that satisfies all the requests in the claim. And if the requirements can be satisfied on more than one node, other scheduling features will determine which node is chosen. This means that the set of devices allocated to a claim might not be the optimal set available to the cluster. Scoring will be implemented later. # noqa: E501 + + :param first_available: The first_available of this V1DeviceRequest. # noqa: E501 + :type first_available: list[V1DeviceSubRequest] + """ + + self._first_available = first_available + + @property + def name(self): + """Gets the name of this V1DeviceRequest. # noqa: E501 + + Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim. References using the name in the DeviceRequest will uniquely identify a request when the Exactly field is set. When the FirstAvailable field is set, a reference to the name of the DeviceRequest will match whatever subrequest is chosen by the scheduler. Must be a DNS label. # noqa: E501 + + :return: The name of this V1DeviceRequest. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1DeviceRequest. + + Name can be used to reference this request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim. References using the name in the DeviceRequest will uniquely identify a request when the Exactly field is set. When the FirstAvailable field is set, a reference to the name of the DeviceRequest will match whatever subrequest is chosen by the scheduler. Must be a DNS label. # noqa: E501 + + :param name: The name of this V1DeviceRequest. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_request_allocation_result.py b/kubernetes_asyncio/client/models/v1_device_request_allocation_result.py new file mode 100644 index 0000000000..e8e2bf1dab --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_request_allocation_result.py @@ -0,0 +1,389 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceRequestAllocationResult(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'admin_access': 'bool', + 'binding_conditions': 'list[str]', + 'binding_failure_conditions': 'list[str]', + 'consumed_capacity': 'dict[str, str]', + 'device': 'str', + 'driver': 'str', + 'pool': 'str', + 'request': 'str', + 'share_id': 'str', + 'tolerations': 'list[V1DeviceToleration]' + } + + attribute_map = { + 'admin_access': 'adminAccess', + 'binding_conditions': 'bindingConditions', + 'binding_failure_conditions': 'bindingFailureConditions', + 'consumed_capacity': 'consumedCapacity', + 'device': 'device', + 'driver': 'driver', + 'pool': 'pool', + 'request': 'request', + 'share_id': 'shareID', + 'tolerations': 'tolerations' + } + + def __init__(self, admin_access=None, binding_conditions=None, binding_failure_conditions=None, consumed_capacity=None, device=None, driver=None, pool=None, request=None, share_id=None, tolerations=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceRequestAllocationResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._admin_access = None + self._binding_conditions = None + self._binding_failure_conditions = None + self._consumed_capacity = None + self._device = None + self._driver = None + self._pool = None + self._request = None + self._share_id = None + self._tolerations = None + self.discriminator = None + + if admin_access is not None: + self.admin_access = admin_access + if binding_conditions is not None: + self.binding_conditions = binding_conditions + if binding_failure_conditions is not None: + self.binding_failure_conditions = binding_failure_conditions + if consumed_capacity is not None: + self.consumed_capacity = consumed_capacity + self.device = device + self.driver = driver + self.pool = pool + self.request = request + if share_id is not None: + self.share_id = share_id + if tolerations is not None: + self.tolerations = tolerations + + @property + def admin_access(self): + """Gets the admin_access of this V1DeviceRequestAllocationResult. # noqa: E501 + + AdminAccess indicates that this device was allocated for administrative access. See the corresponding request field for a definition of mode. This is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled. # noqa: E501 + + :return: The admin_access of this V1DeviceRequestAllocationResult. # noqa: E501 + :rtype: bool + """ + return self._admin_access + + @admin_access.setter + def admin_access(self, admin_access): + """Sets the admin_access of this V1DeviceRequestAllocationResult. + + AdminAccess indicates that this device was allocated for administrative access. See the corresponding request field for a definition of mode. This is an alpha field and requires enabling the DRAAdminAccess feature gate. Admin access is disabled if this field is unset or set to false, otherwise it is enabled. # noqa: E501 + + :param admin_access: The admin_access of this V1DeviceRequestAllocationResult. # noqa: E501 + :type admin_access: bool + """ + + self._admin_access = admin_access + + @property + def binding_conditions(self): + """Gets the binding_conditions of this V1DeviceRequestAllocationResult. # noqa: E501 + + BindingConditions contains a copy of the BindingConditions from the corresponding ResourceSlice at the time of allocation. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501 + + :return: The binding_conditions of this V1DeviceRequestAllocationResult. # noqa: E501 + :rtype: list[str] + """ + return self._binding_conditions + + @binding_conditions.setter + def binding_conditions(self, binding_conditions): + """Sets the binding_conditions of this V1DeviceRequestAllocationResult. + + BindingConditions contains a copy of the BindingConditions from the corresponding ResourceSlice at the time of allocation. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501 + + :param binding_conditions: The binding_conditions of this V1DeviceRequestAllocationResult. # noqa: E501 + :type binding_conditions: list[str] + """ + + self._binding_conditions = binding_conditions + + @property + def binding_failure_conditions(self): + """Gets the binding_failure_conditions of this V1DeviceRequestAllocationResult. # noqa: E501 + + BindingFailureConditions contains a copy of the BindingFailureConditions from the corresponding ResourceSlice at the time of allocation. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501 + + :return: The binding_failure_conditions of this V1DeviceRequestAllocationResult. # noqa: E501 + :rtype: list[str] + """ + return self._binding_failure_conditions + + @binding_failure_conditions.setter + def binding_failure_conditions(self, binding_failure_conditions): + """Sets the binding_failure_conditions of this V1DeviceRequestAllocationResult. + + BindingFailureConditions contains a copy of the BindingFailureConditions from the corresponding ResourceSlice at the time of allocation. This is an alpha field and requires enabling the DRADeviceBindingConditions and DRAResourceClaimDeviceStatus feature gates. # noqa: E501 + + :param binding_failure_conditions: The binding_failure_conditions of this V1DeviceRequestAllocationResult. # noqa: E501 + :type binding_failure_conditions: list[str] + """ + + self._binding_failure_conditions = binding_failure_conditions + + @property + def consumed_capacity(self): + """Gets the consumed_capacity of this V1DeviceRequestAllocationResult. # noqa: E501 + + ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. The consumed amount may differ from the requested amount: it is rounded up to the nearest valid value based on the device’s requestPolicy if applicable (i.e., may not be less than the requested amount). The total consumed capacity for each device must not exceed the DeviceCapacity's Value. This field is populated only for devices that allow multiple allocations. All capacity entries are included, even if the consumed amount is zero. # noqa: E501 + + :return: The consumed_capacity of this V1DeviceRequestAllocationResult. # noqa: E501 + :rtype: dict[str, str] + """ + return self._consumed_capacity + + @consumed_capacity.setter + def consumed_capacity(self, consumed_capacity): + """Sets the consumed_capacity of this V1DeviceRequestAllocationResult. + + ConsumedCapacity tracks the amount of capacity consumed per device as part of the claim request. The consumed amount may differ from the requested amount: it is rounded up to the nearest valid value based on the device’s requestPolicy if applicable (i.e., may not be less than the requested amount). The total consumed capacity for each device must not exceed the DeviceCapacity's Value. This field is populated only for devices that allow multiple allocations. All capacity entries are included, even if the consumed amount is zero. # noqa: E501 + + :param consumed_capacity: The consumed_capacity of this V1DeviceRequestAllocationResult. # noqa: E501 + :type consumed_capacity: dict[str, str] + """ + + self._consumed_capacity = consumed_capacity + + @property + def device(self): + """Gets the device of this V1DeviceRequestAllocationResult. # noqa: E501 + + Device references one device instance via its name in the driver's resource pool. It must be a DNS label. # noqa: E501 + + :return: The device of this V1DeviceRequestAllocationResult. # noqa: E501 + :rtype: str + """ + return self._device + + @device.setter + def device(self, device): + """Sets the device of this V1DeviceRequestAllocationResult. + + Device references one device instance via its name in the driver's resource pool. It must be a DNS label. # noqa: E501 + + :param device: The device of this V1DeviceRequestAllocationResult. # noqa: E501 + :type device: str + """ + if self.local_vars_configuration.client_side_validation and device is None: # noqa: E501 + raise ValueError("Invalid value for `device`, must not be `None`") # noqa: E501 + + self._device = device + + @property + def driver(self): + """Gets the driver of this V1DeviceRequestAllocationResult. # noqa: E501 + + Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. It should use only lower case characters. # noqa: E501 + + :return: The driver of this V1DeviceRequestAllocationResult. # noqa: E501 + :rtype: str + """ + return self._driver + + @driver.setter + def driver(self, driver): + """Sets the driver of this V1DeviceRequestAllocationResult. + + Driver specifies the name of the DRA driver whose kubelet plugin should be invoked to process the allocation once the claim is needed on a node. Must be a DNS subdomain and should end with a DNS domain owned by the vendor of the driver. It should use only lower case characters. # noqa: E501 + + :param driver: The driver of this V1DeviceRequestAllocationResult. # noqa: E501 + :type driver: str + """ + if self.local_vars_configuration.client_side_validation and driver is None: # noqa: E501 + raise ValueError("Invalid value for `driver`, must not be `None`") # noqa: E501 + + self._driver = driver + + @property + def pool(self): + """Gets the pool of this V1DeviceRequestAllocationResult. # noqa: E501 + + This name together with the driver name and the device name field identify which device was allocated (`//`). Must not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes. # noqa: E501 + + :return: The pool of this V1DeviceRequestAllocationResult. # noqa: E501 + :rtype: str + """ + return self._pool + + @pool.setter + def pool(self, pool): + """Sets the pool of this V1DeviceRequestAllocationResult. + + This name together with the driver name and the device name field identify which device was allocated (`//`). Must not be longer than 253 characters and may contain one or more DNS sub-domains separated by slashes. # noqa: E501 + + :param pool: The pool of this V1DeviceRequestAllocationResult. # noqa: E501 + :type pool: str + """ + if self.local_vars_configuration.client_side_validation and pool is None: # noqa: E501 + raise ValueError("Invalid value for `pool`, must not be `None`") # noqa: E501 + + self._pool = pool + + @property + def request(self): + """Gets the request of this V1DeviceRequestAllocationResult. # noqa: E501 + + Request is the name of the request in the claim which caused this device to be allocated. If it references a subrequest in the firstAvailable list on a DeviceRequest, this field must include both the name of the main request and the subrequest using the format
/. Multiple devices may have been allocated per request. # noqa: E501 + + :return: The request of this V1DeviceRequestAllocationResult. # noqa: E501 + :rtype: str + """ + return self._request + + @request.setter + def request(self, request): + """Sets the request of this V1DeviceRequestAllocationResult. + + Request is the name of the request in the claim which caused this device to be allocated. If it references a subrequest in the firstAvailable list on a DeviceRequest, this field must include both the name of the main request and the subrequest using the format
/. Multiple devices may have been allocated per request. # noqa: E501 + + :param request: The request of this V1DeviceRequestAllocationResult. # noqa: E501 + :type request: str + """ + if self.local_vars_configuration.client_side_validation and request is None: # noqa: E501 + raise ValueError("Invalid value for `request`, must not be `None`") # noqa: E501 + + self._request = request + + @property + def share_id(self): + """Gets the share_id of this V1DeviceRequestAllocationResult. # noqa: E501 + + ShareID uniquely identifies an individual allocation share of the device, used when the device supports multiple simultaneous allocations. It serves as an additional map key to differentiate concurrent shares of the same device. # noqa: E501 + + :return: The share_id of this V1DeviceRequestAllocationResult. # noqa: E501 + :rtype: str + """ + return self._share_id + + @share_id.setter + def share_id(self, share_id): + """Sets the share_id of this V1DeviceRequestAllocationResult. + + ShareID uniquely identifies an individual allocation share of the device, used when the device supports multiple simultaneous allocations. It serves as an additional map key to differentiate concurrent shares of the same device. # noqa: E501 + + :param share_id: The share_id of this V1DeviceRequestAllocationResult. # noqa: E501 + :type share_id: str + """ + + self._share_id = share_id + + @property + def tolerations(self): + """Gets the tolerations of this V1DeviceRequestAllocationResult. # noqa: E501 + + A copy of all tolerations specified in the request at the time when the device got allocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. # noqa: E501 + + :return: The tolerations of this V1DeviceRequestAllocationResult. # noqa: E501 + :rtype: list[V1DeviceToleration] + """ + return self._tolerations + + @tolerations.setter + def tolerations(self, tolerations): + """Sets the tolerations of this V1DeviceRequestAllocationResult. + + A copy of all tolerations specified in the request at the time when the device got allocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. # noqa: E501 + + :param tolerations: The tolerations of this V1DeviceRequestAllocationResult. # noqa: E501 + :type tolerations: list[V1DeviceToleration] + """ + + self._tolerations = tolerations + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceRequestAllocationResult): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceRequestAllocationResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_selector.py b/kubernetes_asyncio/client/models/v1_device_selector.py new file mode 100644 index 0000000000..609807995c --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_selector.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceSelector(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'cel': 'V1CELDeviceSelector' + } + + attribute_map = { + 'cel': 'cel' + } + + def __init__(self, cel=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceSelector - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._cel = None + self.discriminator = None + + if cel is not None: + self.cel = cel + + @property + def cel(self): + """Gets the cel of this V1DeviceSelector. # noqa: E501 + + + :return: The cel of this V1DeviceSelector. # noqa: E501 + :rtype: V1CELDeviceSelector + """ + return self._cel + + @cel.setter + def cel(self, cel): + """Sets the cel of this V1DeviceSelector. + + + :param cel: The cel of this V1DeviceSelector. # noqa: E501 + :type cel: V1CELDeviceSelector + """ + + self._cel = cel + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceSelector): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceSelector): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_sub_request.py b/kubernetes_asyncio/client/models/v1_device_sub_request.py new file mode 100644 index 0000000000..4423c03dca --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_sub_request.py @@ -0,0 +1,301 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceSubRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'allocation_mode': 'str', + 'capacity': 'V1CapacityRequirements', + 'count': 'int', + 'device_class_name': 'str', + 'name': 'str', + 'selectors': 'list[V1DeviceSelector]', + 'tolerations': 'list[V1DeviceToleration]' + } + + attribute_map = { + 'allocation_mode': 'allocationMode', + 'capacity': 'capacity', + 'count': 'count', + 'device_class_name': 'deviceClassName', + 'name': 'name', + 'selectors': 'selectors', + 'tolerations': 'tolerations' + } + + def __init__(self, allocation_mode=None, capacity=None, count=None, device_class_name=None, name=None, selectors=None, tolerations=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceSubRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._allocation_mode = None + self._capacity = None + self._count = None + self._device_class_name = None + self._name = None + self._selectors = None + self._tolerations = None + self.discriminator = None + + if allocation_mode is not None: + self.allocation_mode = allocation_mode + if capacity is not None: + self.capacity = capacity + if count is not None: + self.count = count + self.device_class_name = device_class_name + self.name = name + if selectors is not None: + self.selectors = selectors + if tolerations is not None: + self.tolerations = tolerations + + @property + def allocation_mode(self): + """Gets the allocation_mode of this V1DeviceSubRequest. # noqa: E501 + + AllocationMode and its related fields define how devices are allocated to satisfy this subrequest. Supported values are: - ExactCount: This request is for a specific number of devices. This is the default. The exact number is provided in the count field. - All: This subrequest is for all of the matching devices in a pool. Allocation will fail if some devices are already allocated, unless adminAccess is requested. If AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other subrequests must specify this field. More modes may get added in the future. Clients must refuse to handle requests with unknown modes. # noqa: E501 + + :return: The allocation_mode of this V1DeviceSubRequest. # noqa: E501 + :rtype: str + """ + return self._allocation_mode + + @allocation_mode.setter + def allocation_mode(self, allocation_mode): + """Sets the allocation_mode of this V1DeviceSubRequest. + + AllocationMode and its related fields define how devices are allocated to satisfy this subrequest. Supported values are: - ExactCount: This request is for a specific number of devices. This is the default. The exact number is provided in the count field. - All: This subrequest is for all of the matching devices in a pool. Allocation will fail if some devices are already allocated, unless adminAccess is requested. If AllocationMode is not specified, the default mode is ExactCount. If the mode is ExactCount and count is not specified, the default count is one. Any other subrequests must specify this field. More modes may get added in the future. Clients must refuse to handle requests with unknown modes. # noqa: E501 + + :param allocation_mode: The allocation_mode of this V1DeviceSubRequest. # noqa: E501 + :type allocation_mode: str + """ + + self._allocation_mode = allocation_mode + + @property + def capacity(self): + """Gets the capacity of this V1DeviceSubRequest. # noqa: E501 + + + :return: The capacity of this V1DeviceSubRequest. # noqa: E501 + :rtype: V1CapacityRequirements + """ + return self._capacity + + @capacity.setter + def capacity(self, capacity): + """Sets the capacity of this V1DeviceSubRequest. + + + :param capacity: The capacity of this V1DeviceSubRequest. # noqa: E501 + :type capacity: V1CapacityRequirements + """ + + self._capacity = capacity + + @property + def count(self): + """Gets the count of this V1DeviceSubRequest. # noqa: E501 + + Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one. # noqa: E501 + + :return: The count of this V1DeviceSubRequest. # noqa: E501 + :rtype: int + """ + return self._count + + @count.setter + def count(self, count): + """Sets the count of this V1DeviceSubRequest. + + Count is used only when the count mode is \"ExactCount\". Must be greater than zero. If AllocationMode is ExactCount and this field is not specified, the default is one. # noqa: E501 + + :param count: The count of this V1DeviceSubRequest. # noqa: E501 + :type count: int + """ + + self._count = count + + @property + def device_class_name(self): + """Gets the device_class_name of this V1DeviceSubRequest. # noqa: E501 + + DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this subrequest. A class is required. Which classes are available depends on the cluster. Administrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference. # noqa: E501 + + :return: The device_class_name of this V1DeviceSubRequest. # noqa: E501 + :rtype: str + """ + return self._device_class_name + + @device_class_name.setter + def device_class_name(self, device_class_name): + """Sets the device_class_name of this V1DeviceSubRequest. + + DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this subrequest. A class is required. Which classes are available depends on the cluster. Administrators may use this to restrict which devices may get requested by only installing classes with selectors for permitted devices. If users are free to request anything without restrictions, then administrators can create an empty DeviceClass for users to reference. # noqa: E501 + + :param device_class_name: The device_class_name of this V1DeviceSubRequest. # noqa: E501 + :type device_class_name: str + """ + if self.local_vars_configuration.client_side_validation and device_class_name is None: # noqa: E501 + raise ValueError("Invalid value for `device_class_name`, must not be `None`") # noqa: E501 + + self._device_class_name = device_class_name + + @property + def name(self): + """Gets the name of this V1DeviceSubRequest. # noqa: E501 + + Name can be used to reference this subrequest in the list of constraints or the list of configurations for the claim. References must use the format
/. Must be a DNS label. # noqa: E501 + + :return: The name of this V1DeviceSubRequest. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this V1DeviceSubRequest. + + Name can be used to reference this subrequest in the list of constraints or the list of configurations for the claim. References must use the format
/. Must be a DNS label. # noqa: E501 + + :param name: The name of this V1DeviceSubRequest. # noqa: E501 + :type name: str + """ + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def selectors(self): + """Gets the selectors of this V1DeviceSubRequest. # noqa: E501 + + Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this subrequest. All selectors must be satisfied for a device to be considered. # noqa: E501 + + :return: The selectors of this V1DeviceSubRequest. # noqa: E501 + :rtype: list[V1DeviceSelector] + """ + return self._selectors + + @selectors.setter + def selectors(self, selectors): + """Sets the selectors of this V1DeviceSubRequest. + + Selectors define criteria which must be satisfied by a specific device in order for that device to be considered for this subrequest. All selectors must be satisfied for a device to be considered. # noqa: E501 + + :param selectors: The selectors of this V1DeviceSubRequest. # noqa: E501 + :type selectors: list[V1DeviceSelector] + """ + + self._selectors = selectors + + @property + def tolerations(self): + """Gets the tolerations of this V1DeviceSubRequest. # noqa: E501 + + If specified, the request's tolerations. Tolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute. In addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. # noqa: E501 + + :return: The tolerations of this V1DeviceSubRequest. # noqa: E501 + :rtype: list[V1DeviceToleration] + """ + return self._tolerations + + @tolerations.setter + def tolerations(self, tolerations): + """Sets the tolerations of this V1DeviceSubRequest. + + If specified, the request's tolerations. Tolerations for NoSchedule are required to allocate a device which has a taint with that effect. The same applies to NoExecute. In addition, should any of the allocated devices get tainted with NoExecute after allocation and that effect is not tolerated, then all pods consuming the ResourceClaim get deleted to evict them. The scheduler will not let new pods reserve the claim while it has these tainted devices. Once all pods are evicted, the claim will get deallocated. The maximum number of tolerations is 16. This is an alpha field and requires enabling the DRADeviceTaints feature gate. # noqa: E501 + + :param tolerations: The tolerations of this V1DeviceSubRequest. # noqa: E501 + :type tolerations: list[V1DeviceToleration] + """ + + self._tolerations = tolerations + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceSubRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceSubRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_taint.py b/kubernetes_asyncio/client/models/v1_device_taint.py new file mode 100644 index 0000000000..9bdedb0d55 --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_taint.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceTaint(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'effect': 'str', + 'key': 'str', + 'time_added': 'datetime', + 'value': 'str' + } + + attribute_map = { + 'effect': 'effect', + 'key': 'key', + 'time_added': 'timeAdded', + 'value': 'value' + } + + def __init__(self, effect=None, key=None, time_added=None, value=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceTaint - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._effect = None + self._key = None + self._time_added = None + self._value = None + self.discriminator = None + + self.effect = effect + self.key = key + if time_added is not None: + self.time_added = time_added + if value is not None: + self.value = value + + @property + def effect(self): + """Gets the effect of this V1DeviceTaint. # noqa: E501 + + The effect of the taint on claims that do not tolerate the taint and through such claims on the pods using them. Valid effects are None, NoSchedule and NoExecute. PreferNoSchedule as used for nodes is not valid here. More effects may get added in the future. Consumers must treat unknown effects like None. # noqa: E501 + + :return: The effect of this V1DeviceTaint. # noqa: E501 + :rtype: str + """ + return self._effect + + @effect.setter + def effect(self, effect): + """Sets the effect of this V1DeviceTaint. + + The effect of the taint on claims that do not tolerate the taint and through such claims on the pods using them. Valid effects are None, NoSchedule and NoExecute. PreferNoSchedule as used for nodes is not valid here. More effects may get added in the future. Consumers must treat unknown effects like None. # noqa: E501 + + :param effect: The effect of this V1DeviceTaint. # noqa: E501 + :type effect: str + """ + if self.local_vars_configuration.client_side_validation and effect is None: # noqa: E501 + raise ValueError("Invalid value for `effect`, must not be `None`") # noqa: E501 + + self._effect = effect + + @property + def key(self): + """Gets the key of this V1DeviceTaint. # noqa: E501 + + The taint key to be applied to a device. Must be a label name. # noqa: E501 + + :return: The key of this V1DeviceTaint. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this V1DeviceTaint. + + The taint key to be applied to a device. Must be a label name. # noqa: E501 + + :param key: The key of this V1DeviceTaint. # noqa: E501 + :type key: str + """ + if self.local_vars_configuration.client_side_validation and key is None: # noqa: E501 + raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501 + + self._key = key + + @property + def time_added(self): + """Gets the time_added of this V1DeviceTaint. # noqa: E501 + + TimeAdded represents the time at which the taint was added. Added automatically during create or update if not set. # noqa: E501 + + :return: The time_added of this V1DeviceTaint. # noqa: E501 + :rtype: datetime + """ + return self._time_added + + @time_added.setter + def time_added(self, time_added): + """Sets the time_added of this V1DeviceTaint. + + TimeAdded represents the time at which the taint was added. Added automatically during create or update if not set. # noqa: E501 + + :param time_added: The time_added of this V1DeviceTaint. # noqa: E501 + :type time_added: datetime + """ + + self._time_added = time_added + + @property + def value(self): + """Gets the value of this V1DeviceTaint. # noqa: E501 + + The taint value corresponding to the taint key. Must be a label value. # noqa: E501 + + :return: The value of this V1DeviceTaint. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this V1DeviceTaint. + + The taint value corresponding to the taint key. Must be a label value. # noqa: E501 + + :param value: The value of this V1DeviceTaint. # noqa: E501 + :type value: str + """ + + self._value = value + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map( + lambda x: convert(x), + value + )) + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], convert(item[1])), + value.items() + )) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, V1DeviceTaint): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, V1DeviceTaint): + return True + + return self.to_dict() != other.to_dict() diff --git a/kubernetes_asyncio/client/models/v1_device_toleration.py b/kubernetes_asyncio/client/models/v1_device_toleration.py new file mode 100644 index 0000000000..50d11b064e --- /dev/null +++ b/kubernetes_asyncio/client/models/v1_device_toleration.py @@ -0,0 +1,245 @@ +# coding: utf-8 + +""" + Kubernetes + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 + + The version of the OpenAPI document: release-1.35 + Generated by: https://openapi-generator.tech +""" + + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint +import re # noqa: F401 +import six + +from kubernetes_asyncio.client.configuration import Configuration + + +class V1DeviceToleration(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'effect': 'str', + 'key': 'str', + 'operator': 'str', + 'toleration_seconds': 'int', + 'value': 'str' + } + + attribute_map = { + 'effect': 'effect', + 'key': 'key', + 'operator': 'operator', + 'toleration_seconds': 'tolerationSeconds', + 'value': 'value' + } + + def __init__(self, effect=None, key=None, operator=None, toleration_seconds=None, value=None, local_vars_configuration=None): # noqa: E501 + """V1DeviceToleration - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default() + self.local_vars_configuration = local_vars_configuration + + self._effect = None + self._key = None + self._operator = None + self._toleration_seconds = None + self._value = None + self.discriminator = None + + if effect is not None: + self.effect = effect + if key is not None: + self.key = key + if operator is not None: + self.operator = operator + if toleration_seconds is not None: + self.toleration_seconds = toleration_seconds + if value is not None: + self.value = value + + @property + def effect(self): + """Gets the effect of this V1DeviceToleration. # noqa: E501 + + Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule and NoExecute. # noqa: E501 + + :return: The effect of this V1DeviceToleration. # noqa: E501 + :rtype: str + """ + return self._effect + + @effect.setter + def effect(self, effect): + """Sets the effect of this V1DeviceToleration. + + Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule and NoExecute. # noqa: E501 + + :param effect: The effect of this V1DeviceToleration. # noqa: E501 + :type effect: str + """ + + self._effect = effect + + @property + def key(self): + """Gets the key of this V1DeviceToleration. # noqa: E501 + + Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. Must be a label name. # noqa: E501 + + :return: The key of this V1DeviceToleration. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this V1DeviceToleration. + + Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. Must be a label name. # noqa: E501 + + :param key: The key of this V1DeviceToleration. # noqa: E501 + :type key: str + """ + + self._key = key + + @property + def operator(self): + """Gets the operator of this V1DeviceToleration. # noqa: E501 + + Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a ResourceClaim can tolerate all taints of a particular category. # noqa: E501 + + :return: The operator of this V1DeviceToleration. # noqa: E501 + :rtype: str + """ + return self._operator + + @operator.setter + def operator(self, operator): + """Sets the operator of this V1DeviceToleration. + + Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a ResourceClaim can tolerate all taints of a particular category. # noqa: E501 + + :param operator: The operator of this V1DeviceToleration. # noqa: E501 + :type operator: str + """ + + self._operator = operator + + @property + def toleration_seconds(self): + """Gets the toleration_seconds of this V1DeviceToleration. # noqa: E501 + + TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. If larger than zero, the time when the pod needs to be evicted is calculated as